src/backends/cuda/cuda.cpp
// returns a cuda string and dispatch params (blocks, threads)
returns a cuda string and dispatch params (blocks, threads)
returns a cuda string and dispatch params ( blocks threads )
std::pair<std::string, std::pair<size_t, size_t>>
cuda_code_and_dispatch(const LoopTree &lt,
                       const std::unordered_set<LoopTree::TreeRef> &threaded) {
  auto aux = calculate_aux(lt);
  auto cuda_aux = calc_cuda_aux(lt, aux, threaded);
  ASSERT(!needs_multikernel_support(lt, aux, cuda_aux))
      << "This parameterization needs multiple kernels, which is not yet "
         "supported";
  auto cuda_code = cuda_compile(lt, cuda_aux);
  size_t needed_threads = thread_scope(lt, cuda_aux, -1);
  size_t num_blocks = (needed_threads + cuda_aux.threads_per_block - 1) /
                      cuda_aux.threads_per_block;
  size_t num_threads =
      std::min(needed_threads, (size_t)cuda_aux.threads_per_block);
  return std::make_pair(cuda_code, std::make_pair(num_blocks, num_threads));
}
std :: pair < std :: string , std :: pair < size_t , size_t > > cuda_code_and_dispatch ( const LoopTree & lt , const std :: unordered_set < LoopTree :: TreeRef > & threaded ) { auto aux = calculate_aux ( lt ) ; auto cuda_aux = calc_cuda_aux ( lt , aux , threaded ) ; ASSERT ( ! needs_multikernel_support ( lt , aux , cuda_aux ) ) << " " " " ; auto cuda_code = cuda_compile ( lt , cuda_aux ) ; size_t needed_threads = thread_scope ( lt , cuda_aux , -1 ) ; size_t num_blocks = ( needed_threads + cuda_aux . threads_per_block - 1 ) / cuda_aux . threads_per_block ; size_t num_threads = std :: min ( needed_threads , ( size_t ) cuda_aux . threads_per_block ) ; return std :: make_pair ( cuda_code , std :: make_pair ( num_blocks , num_threads ) ) ; }
returns a cuda string and dispatch params (blocks, threads)
returns a cuda string and dispatch params ( blocks threads )