mirror of
https://github.com/NVIDIA/nvbench.git
synced 2026-03-14 20:27:24 +00:00
30 lines
524 B
Plaintext
30 lines
524 B
Plaintext
#include <nvbench/cuda_call.cuh>
|
|
|
|
#include "test_asserts.cuh"
|
|
|
|
namespace
|
|
{
|
|
__global__ void multiply5(const int32_t *__restrict__ a, int32_t *__restrict__ b)
|
|
{
|
|
const auto id = blockIdx.x * blockDim.x + threadIdx.x;
|
|
b[id] = 5 * a[id];
|
|
}
|
|
} // namespace
|
|
|
|
int main()
|
|
{
|
|
multiply5<<<256, 256>>>(nullptr, nullptr);
|
|
|
|
try
|
|
{
|
|
NVBENCH_CUDA_CALL(cudaStreamSynchronize(0));
|
|
ASSERT(false);
|
|
}
|
|
catch (const std::runtime_error &)
|
|
{
|
|
ASSERT(cudaGetLastError() == cudaError_t::cudaSuccess);
|
|
}
|
|
|
|
return 0;
|
|
}
|