File: test_cuda_capture.cu

package info (click to toggle)
taskflow 3.9.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 45,948 kB
  • sloc: cpp: 39,058; xml: 35,572; python: 12,935; javascript: 1,732; makefile: 59; sh: 16
file content (18 lines) | stat: -rw-r--r-- 471 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN

#include <doctest.h>
#include <taskflow/taskflow.hpp>
#include <taskflow/cuda/cudaflow.hpp>

void __global__ testKernel() {}

TEST_CASE("cudaFlowCapturer.noEventError") {
  tf::cudaFlow f;
  f.capture([](tf::cudaFlowCapturer& cpt) {
    cpt.on([] (cudaStream_t stream) {
      testKernel<<<256,256,0,stream>>>();
    });
    REQUIRE((cudaGetLastError() == cudaSuccess));
  });
  REQUIRE((cudaGetLastError() == cudaSuccess));
}