From 9bdc36136825b5f3d81b79de012eae13bfe5a659 Mon Sep 17 00:00:00 2001 From: Tobias Meyer Andersen Date: Wed, 25 Sep 2024 13:43:00 +0200 Subject: [PATCH] fix cmake and cuda bugs --- CMakeLists_files.cmake | 6 +++--- tests/gpuistl/test_gpu_linear_two_phase_material.cu | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index 4e5cd5e5c..eb92e6e71 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -455,11 +455,11 @@ if (HAVE_CUDA) if(NOT CONVERT_CUDA_TO_HIP) set(CU_FILES_NEEDING_RELAXED_CONSTEXPR tests/gpuistl/test_gpu_ad.cu - tests/gpuistl/gpu_linear_two_phase_material.cu + tests/gpuistl/test_gpu_linear_two_phase_material.cu ) - foreach(file ${LIST_OF_FILES}) - set_source_file_properties(${file} "--expt-relaxed-constexpr") + foreach(file ${CU_FILES_NEEDING_RELAXED_CONSTEXPR}) + set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS "--expt-relaxed-constexpr") endforeach() endif() endif() diff --git a/tests/gpuistl/test_gpu_linear_two_phase_material.cu b/tests/gpuistl/test_gpu_linear_two_phase_material.cu index 69729c36e..ebbd3ac99 100644 --- a/tests/gpuistl/test_gpu_linear_two_phase_material.cu +++ b/tests/gpuistl/test_gpu_linear_two_phase_material.cu @@ -95,7 +95,7 @@ BOOST_AUTO_TEST_CASE(TestSimpleInterpolation) OPM_GPU_SAFE_CALL(cudaMemcpy(gpuAdInput, &cpuMadeAd, sizeof(NorneEvaluation), cudaMemcpyHostToDevice)); gpuTwoPhaseSatPcnwWrapper<<<1,1>>>(gpuViewParams, *gpuAdInput, gpuAdResOnGPU); OPM_GPU_SAFE_CALL(cudaDeviceSynchronize()); - OPM_GPU_SAFE_CALL(cudaMemcpy(gpuAdResOnCPU, gpuAdResOnGPU, sizeof(NorneEvaluation), cudaMemcpyDeviceToHost)); + OPM_GPU_SAFE_CALL(cudaMemcpy(&gpuAdResOnCPU, gpuAdResOnGPU, sizeof(NorneEvaluation), cudaMemcpyDeviceToHost)); BOOST_CHECK(gpuAdResOnCPU == cpuInterpolatedEval); }