Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions src/cuda/cuda_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,6 @@ class CudaError : public std::runtime_error {
} \
} while (0)

#ifdef NDEBUG
#define CUDA_CHECK_LAUNCH() \
do { \
cudaError_t err = cudaPeekAtLastError(); \
if (err != cudaSuccess) { \
std::stringstream ss; \
ss << "CUDA launch error in " << __func__ << " at " \
<< __FILE__ << ":" << __LINE__ << " - " \
<< cudaGetErrorString(err); \
throw Generators::CudaError(ss.str(), err); \
Comment thread
tianleiwu marked this conversation as resolved.
} \
} while (0)
#else
#define CUDA_CHECK_LAUNCH() \
do { \
cudaError_t err = cudaGetLastError(); \
Expand All @@ -153,6 +140,5 @@ class CudaError : public std::runtime_error {
throw Generators::CudaError(ss.str(), err); \
} \
} while (0)
#endif

} // namespace Generators
1 change: 1 addition & 0 deletions src/cuda/cuda_topk_benchmark.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ static const char* TopkAlgoToString(TopkAlgo algo) {
best_algo = algo_enum; \
} \
} catch (const Generators::CudaError& e) { \
cudaGetLastError(); \
std::cerr << "Benchmarking failed for " << TopkAlgoToString(algo_enum) \
<< " kernel with k=" << k << ", batch_size=" << batch_size \
<< ", vocab_size=" << vocab_size << ". Error: " << e.what() << std::endl; \
Expand Down
Loading