summaryrefslogtreecommitdiff
path: root/tangle/nozzle.cu
diff options
context:
space:
mode:
Diffstat (limited to 'tangle/nozzle.cu')
-rw-r--r--tangle/nozzle.cu8
1 files changed, 6 insertions, 2 deletions
diff --git a/tangle/nozzle.cu b/tangle/nozzle.cu
index 03c18f9..5278096 100644
--- a/tangle/nozzle.cu
+++ b/tangle/nozzle.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, 80, 80);
Lattice<DESCRIPTOR,T> lattice(cuboid);
@@ -46,7 +50,7 @@ auto boundary_mask = materials.mask_of_material(2);
auto inflow_mask = materials.mask_of_material(3);
auto outflow_mask = materials.mask_of_material(4);
-cudaDeviceSynchronize();
+cuda::synchronize(current);
VolumetricExample renderer(cuboid);
renderer.add<CurlNormS>(lattice, bulk_mask, obstacle);