fix cmake and cuda bugs

This commit is contained in:
Tobias Meyer Andersen 2024-09-25 13:43:00 +02:00
parent c288f7f0fb
commit 9bdc361368
2 changed files with 4 additions and 4 deletions

View File

@ -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()

View File

@ -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);
}