diff --git a/catch/unit/complex/complex.cc b/catch/unit/complex/complex.cc index 1d8dc0d40a..2d483db577 100644 --- a/catch/unit/complex/complex.cc +++ b/catch/unit/complex/complex.cc @@ -98,26 +98,6 @@ TEMPLATE_TEST_CASE("Unit_Device_Complex_Unary_Host_Sanity_Positive", "", hipFloa } } -/** - * Test Description - * ------------------------ - * - RTCs kernels that pass argument of invalid type for unary complex functions. - * - * Test source - * ------------------------ - * - unit/complex/complex.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ -TEST_CASE("Unit_Device_Complex_Unary_Negative_Parameters_RTC") { - ComplexTypeRTCWrapper<42>(kComplexConj); - ComplexTypeRTCWrapper<28>(kComplexReal); - ComplexTypeRTCWrapper<28>(kComplexImag); - ComplexTypeRTCWrapper<28>(kComplexAbs); - ComplexTypeRTCWrapper<29>(kComplexSqabs); -} - /** * Test Description * ------------------------ @@ -186,25 +166,6 @@ TEMPLATE_TEST_CASE("Unit_Device_Complex_Binary_Host_Sanity_Positive", "", hipFlo } } -/** - * Test Description - * ------------------------ - * - RTCs kernels that pass argument of invalid type for binary complex functions. - * - * Test source - * ------------------------ - * - unit/complex/complex.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ -TEST_CASE("Unit_Device_Complex_Binary_Negative_Parameters_RTC") { - ComplexTypeRTCWrapper<66>(kComplexAdd); - ComplexTypeRTCWrapper<66>(kComplexSub); - ComplexTypeRTCWrapper<66>(kComplexMul); - ComplexTypeRTCWrapper<66>(kComplexDiv); -} - /** * Test Description * ------------------------ @@ -263,22 +224,6 @@ TEMPLATE_TEST_CASE("Unit_Device_Complex_hipCfma_Host_Sanity_Positive", "", hipFl ComplexFunctionTernaryHostTest(ComplexFunction::kFma, input_val1, input_val2, input_val3); } -/** - * Test Description - * ------------------------ - * - RTCs kernels that pass argument of invalid type for hipCfma/hipCfmaf complex function. - * - * Test source - * ------------------------ - * - unit/complex/complex.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ -TEST_CASE("Unit_Device_Complex_hipCfma_Negative_Parameters_RTC") { - ComplexTypeRTCWrapper<90>(kComplexFma); -} - /** * Test Description * ------------------------ @@ -385,24 +330,6 @@ TEST_CASE("Unit_Device_make_hipComplex_Host_Positive") { } #endif -/** - * Test Description - * ------------------------ - * - RTCs kernels that pass argument of invalid type for make complex functions. - * - * Test source - * ------------------------ - * - unit/complex/complex.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ -TEST_CASE("Unit_Device_make_Complex_Negative_Parameters_RTC") { - ComplexTypeRTCWrapper<27>(kMakeHipComplex); - ComplexTypeRTCWrapper<27>(kMakeHipFloatComplex); - ComplexTypeRTCWrapper<27>(kMakeHipDoubleComplex); -} - /** * Test Description * ------------------------ @@ -461,23 +388,6 @@ TEMPLATE_TEST_CASE("Unit_Device_Complex_Cast_Host_Sanity_Positive", "", hipFloat REQUIRE(result.y == static_cast().x)>(input_i)); } -/** - * Test Description - * ------------------------ - * - RTCs kernels that pass argument of invalid type for complex cast functions. - * - * Test source - * ------------------------ - * - unit/complex/complex.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ -TEST_CASE("Unit_Device_Complex_Cast_Negative_Parameters_RTC") { - ComplexTypeRTCWrapper<21>(kComplexDoubleToFloat); - ComplexTypeRTCWrapper<21>(kComplexFloatToDouble); -} - /** * End doxygen group ComplexTest. * @} diff --git a/catch/unit/complex/complex_basic_common.hh b/catch/unit/complex/complex_basic_common.hh index d60b9a4f13..0e5248c7e2 100644 --- a/catch/unit/complex/complex_basic_common.hh +++ b/catch/unit/complex/complex_basic_common.hh @@ -72,41 +72,3 @@ template void CompareValues(T actual_val, T ref_val, double margin) REQUIRE_THAT(actual_val, Catch::WithinAbs(ref_val, margin)); } } - -template void ComplexTypeRTCWrapper(const char* program_source) { - hiprtcProgram program{}; - HIPRTC_CHECK(hiprtcCreateProgram(&program, program_source, "complex_type_kernels.cc", 0, nullptr, - nullptr)); - -#if HT_AMD - std::string args = std::string("-ferror-limit=100"); - const char* options[] = {args.c_str()}; - hiprtcResult result{hiprtcCompileProgram(program, 1, options)}; -#else - // read from CMakeLists.txt file add_definitions - std::string hip_path = HIP_PATH; - // nvcc errors if headers with relative paths are included - std::string opts_pre = "--pre-include="+ hip_path + "/include/hip/nvidia_detail/nvidia_hip_complex.h"; - std::string opts_pos = "--include-path=/usr/local/cuda/include"; - const char* options[] = {"-default-device" , opts_pre.c_str(), opts_pos.c_str()}; - hiprtcResult result{hiprtcCompileProgram(program, 3, options)}; -#endif - - size_t log_size{}; - HIPRTC_CHECK(hiprtcGetProgramLogSize(program, &log_size)); - std::string log(log_size, ' '); - HIPRTC_CHECK(hiprtcGetProgramLog(program, log.data())); - int error_count{0}; - - std::string error_message{"error:"}; - - size_t npos_e = log.find(error_message, 0); - while (npos_e != std::string::npos) { - ++error_count; - npos_e = log.find(error_message, npos_e + 1); - } - - HIPRTC_CHECK(hiprtcDestroyProgram(&program)); - HIPRTC_CHECK_ERROR(result, HIPRTC_ERROR_COMPILATION); - REQUIRE(error_count == expected_errors_num); -} diff --git a/catch/unit/vector_types/vector_types.cc b/catch/unit/vector_types/vector_types.cc index 654d674385..9bc221d498 100644 --- a/catch/unit/vector_types/vector_types.cc +++ b/catch/unit/vector_types/vector_types.cc @@ -292,68 +292,6 @@ TEMPLATE_TEST_CASE("Unit_VectorAndValueTypeOperations_SanityCheck_Basic_Device", } } } - -template void VectorTypesRTCWrapper(const char* program_source) { - hiprtcProgram program{}; - HIPRTC_CHECK(hiprtcCreateProgram(&program, program_source, "vector_types_kernels.cc", 0, nullptr, - nullptr)); - -#if HT_AMD - std::string args = std::string("-ferror-limit=100"); - const char* options[] = {args.c_str()}; - hiprtcResult result{hiprtcCompileProgram(program, 1, options)}; -#else - hiprtcResult result{hiprtcCompileProgram(program, 0, nullptr)}; -#endif - - size_t log_size{}; - HIPRTC_CHECK(hiprtcGetProgramLogSize(program, &log_size)); - std::string log(log_size, ' '); - HIPRTC_CHECK(hiprtcGetProgramLog(program, log.data())); - int error_count{0}; - - std::string error_message{"error:"}; - - size_t npos_e = log.find(error_message, 0); - while (npos_e != std::string::npos) { - ++error_count; - npos_e = log.find(error_message, npos_e + 1); - } - - HIPRTC_CHECK(hiprtcDestroyProgram(&program)); - HIPRTC_CHECK_ERROR(result, HIPRTC_ERROR_COMPILATION); - REQUIRE(error_count == expected_errors_num); -} - -/** - * Test Description - * ------------------------ - * - Compiles kernels and host functions with negative scenarios: - * -# Negate (-) operator on the unsigned vectors - * -# Bitwise operators on the floating-point vectors - * -# Calculate-assign operators that are not supported between vector and scalar - * - Utilizes HIP RTC for compilation - * Test source - * ------------------------ - * - unit/vector_types/vector_types.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ -TEST_CASE("Unit_VectorOperators_Negative_Parameters_RTC") { - VectorTypesRTCWrapper<8>(kNegateUnsignedChar); - VectorTypesRTCWrapper<8>(kNegateUnsignedShort); - VectorTypesRTCWrapper<8>(kNegateUnsignedInt); - VectorTypesRTCWrapper<8>(kNegateUnsignedLong); - VectorTypesRTCWrapper<8>(kNegateUnsignedLongLong); - VectorTypesRTCWrapper<96>(kBitwiseFloat); - VectorTypesRTCWrapper<96>(kBitwiseDouble); - VectorTypesRTCWrapper<96>(kCalculateAssignChar); - VectorTypesRTCWrapper<96>(kCalculateAssignShort); - VectorTypesRTCWrapper<96>(kCalculateAssignInt); - VectorTypesRTCWrapper<96>(kCalculateAssignLong); - VectorTypesRTCWrapper<96>(kCalculateAssignLongLong); -} #endif // HT_AMD /**