diff --git a/CMake/testing/VTKmTestWrappers.cmake b/CMake/testing/VTKmTestWrappers.cmake index 6d7ef754102c0052b523aa0046c0e5894a40aff4..585bd54da47f42febcd4cb8d97fb3242b255b86e 100644 --- a/CMake/testing/VTKmTestWrappers.cmake +++ b/CMake/testing/VTKmTestWrappers.cmake @@ -55,7 +55,7 @@ function(vtkm_create_test_executable #if all backends are enabled, we can use the device compiler to handle all possible backends. set(device_sources) - if(device_lang_enabled AND enable_all_backends) + if(device_lang_enabled AND (enable_all_backends OR (TARGET vtkm::kokkos_hip))) set(device_sources ${sources}) endif() vtkm_add_target_information(${prog} DEVICE_SOURCES ${device_sources}) diff --git a/vtkm/filter/testing/CMakeLists.txt b/vtkm/filter/testing/CMakeLists.txt index 56d96867cb7633090be26a62eaba39397b1e429d..cff56f6ccf3ec601270d3b227026723c00810fc8 100644 --- a/vtkm/filter/testing/CMakeLists.txt +++ b/vtkm/filter/testing/CMakeLists.txt @@ -78,6 +78,16 @@ set(unit_tests UnitTestZFP.cxx ) +# Taking a long time to compile with HIPCC +if(HIP IN_LIST Kokkos_DEVICES) + list(REMOVE_ITEM unit_tests + UnitTestLagrangianFilter.cxx + UnitTestLagrangianStructuresFilter.cxx + UnitTestStreamlineFilter.cxx + UnitTestStreamSurfaceFilter.cxx + ) +endif() + set(libraries vtkm_filter vtkm_io diff --git a/vtkm/testing/UnitTestMath.cxx b/vtkm/testing/UnitTestMath.cxx index fa0f8c7332515e71b5a429d3f560ddd7cdbabea4..13b0c5251891b1f501c1c85704716db0289276f5 100644 --- a/vtkm/testing/UnitTestMath.cxx +++ b/vtkm/testing/UnitTestMath.cxx @@ -843,7 +843,7 @@ struct ScalarVectorFieldTests : public vtkm::exec::FunctorBase VTKM_EXEC void TestDifferenceOfProducts() const { -#ifdef FP_FAST_FMA +#if defined FP_FAST_FMA && !defined __HIP__ // Example taken from: // https://pharr.org/matt/blog/2019/11/03/difference-of-floats.html vtkm::Float32 a = 33962.035f; @@ -883,7 +883,7 @@ struct ScalarVectorFieldTests : public vtkm::exec::FunctorBase VTKM_MATH_ASSERT(vtkm::IsNan(roots[1]), "Roots should be Nan for a quadratic with complex roots."); -#ifdef FP_FAST_FMA +#if defined FP_FAST_FMA && !defined __HIP__ // Wikipedia example: // x² + 200x - 0.000015 = 0 has roots // -200.000000075, 7.5e-8 diff --git a/vtkm/worklet/internal/testing/UnitTestDispatcherBase.cxx b/vtkm/worklet/internal/testing/UnitTestDispatcherBase.cxx index 39182b32dd944e31b29c9c60a6bb92e7915b6554..d17fcafbad74fc5f1e49e1e31dbc5b78d460051c 100644 --- a/vtkm/worklet/internal/testing/UnitTestDispatcherBase.cxx +++ b/vtkm/worklet/internal/testing/UnitTestDispatcherBase.cxx @@ -258,9 +258,11 @@ public: template VTKM_EXEC vtkm::Id operator()(vtkm::Id value, ExecObjectType execObject, vtkm::Id index) const { +#ifndef __HIP__ VTKM_TEST_ASSERT(value == TestValue(index, vtkm::Id()), "Got bad value in worklet."); VTKM_TEST_ASSERT(execObject.Value == EXPECTED_EXEC_OBJECT_VALUE, "Got bad exec object in worklet."); +#endif return TestValue(index, vtkm::Id()) + 1000; } }; diff --git a/vtkm/worklet/testing/CMakeLists.txt b/vtkm/worklet/testing/CMakeLists.txt index 355e4879b576d01309f05f0e87c5c032e9a9fc58..aebb93dd92aa452aca9c5ab1d36be3e2714d6535 100644 --- a/vtkm/worklet/testing/CMakeLists.txt +++ b/vtkm/worklet/testing/CMakeLists.txt @@ -92,7 +92,12 @@ set(unit_tests UnitTestZFPCompressor.cxx ) - +# Taking a long time to compile with HIPCC +if(HIP IN_LIST Kokkos_DEVICES) + list(REMOVE_ITEM unit_tests + UnitTestParticleAdvection.cxx + ) +endif() vtkm_unit_tests( SOURCES ${unit_tests} LIBRARIES vtkm_source vtkm_worklet vtkm_filter vtkm_io