diff options
author | Adrian Kummerlaender | 2021-09-12 14:01:55 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2021-09-12 14:01:55 +0200 |
commit | 32dd41a728ce10113032e20955ba08f8de449857 (patch) | |
tree | 8a5f851a342590d05137b2c900a7d3c4e8c545b6 /tangle/taylor-couette.cu | |
parent | 8bca21a550e0ef134d51c4c4c007720885d76791 (diff) | |
download | LiterateLB-32dd41a728ce10113032e20955ba08f8de449857.tar LiterateLB-32dd41a728ce10113032e20955ba08f8de449857.tar.gz LiterateLB-32dd41a728ce10113032e20955ba08f8de449857.tar.bz2 LiterateLB-32dd41a728ce10113032e20955ba08f8de449857.tar.lz LiterateLB-32dd41a728ce10113032e20955ba08f8de449857.tar.xz LiterateLB-32dd41a728ce10113032e20955ba08f8de449857.tar.zst LiterateLB-32dd41a728ce10113032e20955ba08f8de449857.zip |
Start using C++ cuda-api-wrapper instead of raw CUDA
Diffstat (limited to 'tangle/taylor-couette.cu')
-rw-r--r-- | tangle/taylor-couette.cu | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tangle/taylor-couette.cu b/tangle/taylor-couette.cu index 2e69bfb..6b39afa 100644 --- a/tangle/taylor-couette.cu +++ b/tangle/taylor-couette.cu @@ -15,7 +15,11 @@ using T = float; using DESCRIPTOR = descriptor::D3Q19; int main() { -cudaSetDevice(0); +if (cuda::device::count() == 0) { + std::cerr << "No CUDA devices on this system" << std::endl; + return -1; +} +auto current = cuda::device::current::get(); const descriptor::Cuboid<DESCRIPTOR> cuboid(500, 96, 96); Lattice<DESCRIPTOR,T> lattice(cuboid); @@ -55,7 +59,7 @@ auto bulk_list = materials.list_of_material(1); auto wall_mask = materials.mask_of_material(2); auto wall_list = materials.list_of_material(2); -cudaDeviceSynchronize(); +cuda::synchronize(current); VolumetricExample renderer(cuboid); renderer.add<VelocityNormS>(lattice, bulk_mask, inner_cylinder); |