Skip to content

Commit

Permalink
Debug self host: check whether the original kernel produces errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kchristin22 committed Oct 8, 2024
1 parent 40ead4c commit 54c8954
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/CUDA/GradientKernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,10 @@ int main(void) {
cudaMemcpy(dy, fives, 10 * sizeof(double), cudaMemcpyHostToDevice);
cudaMemcpy(d_val, zeros, sizeof(double), cudaMemcpyHostToDevice);

device_pullback<<<1, 10>>>(y, x, 5);
cudaDeviceSynchronize();
printf("%s\n", cudaGetErrorString(cudaGetLastError())); // CHECK-EXEC: no error

auto test_device = clad::gradient(device_pullback, "out, val");
test_device.execute_kernel(dim3(1), dim3(10, 1, 1), x, y, 5, dy, d_val);
cudaDeviceSynchronize();
Expand Down

0 comments on commit 54c8954

Please sign in to comment.