diff --git a/src/serac/physics/heat_transfer.hpp b/src/serac/physics/heat_transfer.hpp index d8563ed727..eed756ca97 100644 --- a/src/serac/physics/heat_transfer.hpp +++ b/src/serac/physics/heat_transfer.hpp @@ -296,17 +296,16 @@ class HeatTransfer, std::integer_sequ * @param[in] material A functor representing the material model. Should be a functor, or a class/struct with * public operator() method. Must NOT be a generic lambda, or serac will not compile due to static asserts below. */ - ThermalMaterialIntegrand(MaterialType material) : material_(material) {} - - // Due to nvcc's lack of support for extended generic lambdas (i.e. functions of the form - // auto lambda = [] __host__ __device__ (auto) {}; ), MaterialType cannot be an extended - // generic lambda. The static asserts below check this. - private: - class DummyArgumentType { - }; - static_assert(!std::is_invocable::value); - static_assert(!std::is_invocable::value); - static_assert(!std::is_invocable::value); + ThermalMaterialIntegrand(MaterialType material) : material_(material) + { +// Due to nvcc's lack of support for extended generic lambdas (i.e. functions of the form +// auto lambda = [] __host__ __device__ (auto) {}; ), MaterialType cannot be an extended +// generic lambda. The static asserts below check this. +#ifdef __CUDACC__ + static_assert(!__nv_is_extended_host_device_lambda_closure_type(MaterialType), + "NVCC does not support host device lambdas"); +#endif + } public: /**