diff --git a/catch/hipTestMain/config/config_amd_linux b/catch/hipTestMain/config/config_amd_linux index 98adde7bc1..388d5921e5 100644 --- a/catch/hipTestMain/config/config_amd_linux +++ b/catch/hipTestMain/config/config_amd_linux @@ -16,8 +16,6 @@ "Unit_hipStreamPerThread_DeviceReset_1", "Unit_hipDeviceGetSharedMemConfig_Positive_Basic", "Unit_hipDeviceGetSharedMemConfig_Positive_Threaded", - "Unit_hipDeviceGetCacheConfig_Positive_Basic", - "Unit_hipDeviceGetCacheConfig_Positive_Threaded", "Unit_hipGetDeviceFlags_Positive_Context", "Unit_hipInit_Negative", "Unit_hipDeviceReset_Positive_Basic", diff --git a/catch/hipTestMain/config/config_amd_windows b/catch/hipTestMain/config/config_amd_windows index 6772081d53..91a6107dcf 100644 --- a/catch/hipTestMain/config/config_amd_windows +++ b/catch/hipTestMain/config/config_amd_windows @@ -63,9 +63,6 @@ "Unit_hipGraphMemcpyNodeSetParamsToSymbol_Functional", "Unit_hipStreamWaitEvent_DifferentStreams", "Unit_hipStreamQuery_WithFinishedWork", - "Unit_hipDeviceGetCacheConfig_Positive_Basic", - "Unit_hipDeviceGetCacheConfig_Positive_Basic", - "Unit_hipDeviceGetCacheConfig_Positive_Threaded", "SWDEV-347670 - blocking tests have TDR, causing hangs", "Unit_hipStreamValue_Wait32_Blocking_Mask_Gte", "Unit_hipStreamValue_Wait32_Blocking_Mask_Eq_1", diff --git a/catch/hipTestMain/config/config_amd_wsl.json b/catch/hipTestMain/config/config_amd_wsl.json index 857cc32fe0..424cc0c83d 100644 --- a/catch/hipTestMain/config/config_amd_wsl.json +++ b/catch/hipTestMain/config/config_amd_wsl.json @@ -54,9 +54,6 @@ "Unit_hipGraphMemcpyNodeSetParamsToSymbol_Functional", "Unit_hipStreamWaitEvent_DifferentStreams", "Unit_hipStreamQuery_WithFinishedWork", - "Unit_hipDeviceGetCacheConfig_Positive_Basic", - "Unit_hipDeviceGetCacheConfig_Positive_Basic", - "Unit_hipDeviceGetCacheConfig_Positive_Threaded", "Unit_hipStreamValue_Wait32_Blocking_Mask_Gte", "Unit_hipStreamValue_Wait32_Blocking_Mask_Eq_1", "Unit_hipStreamValue_Wait32_Blocking_Mask_Eq_2", @@ -361,8 +358,6 @@ "Unit_hipStreamPerThread_DeviceReset_1", "Unit_hipDeviceGetSharedMemConfig_Positive_Basic", "Unit_hipDeviceGetSharedMemConfig_Positive_Threaded", - "Unit_hipDeviceGetCacheConfig_Positive_Basic", - "Unit_hipDeviceGetCacheConfig_Positive_Threaded", "Unit_hipGetDeviceFlags_Positive_Context", "Unit_hipIpcCloseMemHandle_Negative_Close_In_Originating_Process", "Unit_hipIpcOpenMemHandle_Negative_Open_In_Creating_Process", diff --git a/catch/unit/device/hipDeviceSetGetCacheConfig.cc b/catch/unit/device/hipDeviceSetGetCacheConfig.cc index 1f92699ebd..dea4f4b42e 100644 --- a/catch/unit/device/hipDeviceSetGetCacheConfig.cc +++ b/catch/unit/device/hipDeviceSetGetCacheConfig.cc @@ -19,10 +19,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include - #include -#include /** * @addtogroup hipDeviceSetCacheConfig hipDeviceSetCacheConfig @@ -59,25 +56,6 @@ TEST_CASE("Unit_hipDeviceSetCacheConfig_Positive_Basic") { HIP_CHECK(hipDeviceSetCacheConfig(cache_config)); } -/** - * Test Description - * ------------------------ - * - Handle invalid cache config (-1): - * -# When platform is AMD - * - Expected output: return `hipErrorNotSupported` - * -# When platform is NVIDIA - * - Expected output: return `hipErrorInvalidValue` - * Test source - * ------------------------ - * - unit/device/hipDeviceSetGetCacheConfig.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ -TEST_CASE("Unit_hipDeviceSetCacheConfig_Negative_Parameters") { - HIP_CHECK_ERROR(hipDeviceSetCacheConfig(static_cast(-1)), hipErrorInvalidValue); -} - /** * End doxygen group hipDeviceSetCacheConfig. * @} @@ -112,85 +90,3 @@ TEST_CASE("Unit_hipDeviceGetCacheConfig_Positive_Default") { HIP_CHECK(hipDeviceGetCacheConfig(&cache_config)); REQUIRE(cache_config == hipFuncCachePreferNone); } - -/** - * Test Description - * ------------------------ - * - Check that the returned cache configuration is equal to - * the one that is set previously. - * - Verify for multiple devices. - * Test source - * ------------------------ - * - unit/device/hipDeviceSetGetCacheConfig.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ -TEST_CASE("Unit_hipDeviceGetCacheConfig_Positive_Basic") { - const auto device = GENERATE(range(0, HipTest::getDeviceCount())); - HIP_CHECK(hipSetDevice(device)); - INFO("Current device is: " << device); - - const auto cache_config = - GENERATE(from_range(std::begin(kCacheConfigs), std::end(kCacheConfigs))); - - HIP_CHECK(hipDeviceSetCacheConfig(cache_config)); - hipFuncCache_t returned_cache_config; - HIP_CHECK(hipDeviceGetCacheConfig(&returned_cache_config)); - - REQUIRE(returned_cache_config == cache_config); -} - -/** - * Test Description - * ------------------------ - * - Check that the returned cache configuration from the main thread - * is equal to the one that is set previously from different thread. - * Test source - * ------------------------ - * - unit/device/hipDeviceSetGetCacheConfig.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ -TEST_CASE("Unit_hipDeviceGetCacheConfig_Positive_Threaded") { - class HipDeviceSetGetCacheConfigTest : public ThreadedZigZagTest { - public: - HipDeviceSetGetCacheConfigTest(const hipFuncCache_t cache_config) - : cache_config_{cache_config} {} - - void TestPart2() { HIP_CHECK_THREAD(hipDeviceSetCacheConfig(cache_config_)); } - - void TestPart3() { - hipFuncCache_t returned_cache_config; - HIP_CHECK_THREAD(hipDeviceGetCacheConfig(&returned_cache_config)); - REQUIRE_THREAD(returned_cache_config == cache_config_); - } - - private: - const hipFuncCache_t cache_config_; - }; - - const auto cache_config = - GENERATE(from_range(std::begin(kCacheConfigs), std::end(kCacheConfigs))); - - HipDeviceSetGetCacheConfigTest test(cache_config); - test.run(); -} - -/** - * Test Description - * ------------------------ - * - Verify handling of invalid arguments: - * -# When cache config is `nullptr` - * - Expected output: return `hipErrorInvalidValue` - * Test source - * ------------------------ - * - unit/device/hipDeviceSetGetCacheConfig.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ -TEST_CASE("Unit_HipDeviceGetCacheConfig_Negative_Parameters") { - HIP_CHECK_ERROR(hipDeviceGetCacheConfig(nullptr), hipErrorInvalidValue); -}