MCPcopy Create free account
hub / github.com/AdaptiveCpp/AdaptiveCpp / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

tests/pcuda/interop.cpp:23–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22
23BOOST_AUTO_TEST_CASE(nd_item) {
24 int* data;
25 int problem_size = 1024;
26 int group_size = 128;
27 BOOST_TEST(pcudaMallocManaged(&data, problem_size * sizeof(int)) == pcudaSuccess);
28
29 for(int i = 0; i < problem_size; ++i)
30 data[i] = i;
31
32 auto err = pcudaParallelFor(problem_size / group_size, group_size, [=](){
33 auto item = sycl::AdaptiveCpp_pcuda::this_nd_item<1>();
34 data[item.get_global_linear_id()] += 1;
35 });
36 BOOST_CHECK(err == pcudaSuccess);
37
38 BOOST_CHECK(pcudaDeviceSynchronize() == pcudaSuccess);
39 for(int i = 0; i < problem_size; ++i) {
40 BOOST_CHECK(data[i] == i + 1);
41 }
42
43 BOOST_CHECK(pcudaFree(data) == pcudaSuccess);
44}
45
46BOOST_AUTO_TEST_CASE(queue) {
47 int* data;

Callers

nothing calls this directly

Calls 5

pcudaMallocManagedFunction · 0.85
pcudaParallelForFunction · 0.85
make_queueFunction · 0.85
get_global_linear_idMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected