From 9aa7ea3e5c7c46e6d9e540d11b4b1dce61ad0ae3 Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Tue, 9 Jan 2024 13:49:57 +0000 Subject: [PATCH] [HIPIFY][tests][fix] Split the test `headers/headers_test_12_SOLVER.cu` [Reasons] + `cusolverMg.h` appeared in CUDA 10.1 + `cusolverSp_LOWLEVEL_PREVIEW.h` appeared in CUDA 7.5 --- tests/lit.cfg | 4 +++ .../headers/headers_test_12_SOLVER.cu | 6 ---- .../headers/headers_test_12_SOLVER_10010.cu | 30 +++++++++++++++++++ .../headers/headers_test_12_SOLVER_7050.cu | 24 +++++++++++++++ 4 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 tests/unit_tests/headers/headers_test_12_SOLVER_10010.cu create mode 100644 tests/unit_tests/headers/headers_test_12_SOLVER_7050.cu diff --git a/tests/lit.cfg b/tests/lit.cfg index 4fe2dff1..ebb4622c 100644 --- a/tests/lit.cfg +++ b/tests/lit.cfg @@ -48,6 +48,7 @@ if config.cuda_version_major == 7 and config.cuda_version_minor == 0: config.excludes.append('headers_test_09.cu') config.excludes.append('cudnn_convolution_forward.cu') config.excludes.append('cusparse2rocsparse_7500.cu') + config.excludes.append('headers_test_12_SOLVER_7050.cu') if config.cuda_version_major < 8: config.excludes.append('cuSPARSE_02.cu') @@ -76,6 +77,9 @@ if config.cuda_version_major < 10: config.excludes.append('simple_mechs.cu') config.excludes.append('cusparse2rocsparse_10000.cu') +if config.cuda_version_major <= 10: + config.excludes.append('headers_test_12_SOLVER_10010.cu') + if config.cuda_version_major > 10: clang_arguments += " -DTHRUST_IGNORE_CUB_VERSION_CHECK" config.excludes.append('cudnn_convolution_forward.cu') diff --git a/tests/unit_tests/headers/headers_test_12_SOLVER.cu b/tests/unit_tests/headers/headers_test_12_SOLVER.cu index de76b3fe..1f407b34 100644 --- a/tests/unit_tests/headers/headers_test_12_SOLVER.cu +++ b/tests/unit_tests/headers/headers_test_12_SOLVER.cu @@ -15,14 +15,8 @@ static int counter = 0; // CHECK-NOT: #include "cusolverDn.h" // CHECK-NOT: #include "cusolverRf.h" // CHECK-NOT: #include "cusolverSp.h" -// CHECK-NOT: #include "cusolverSp_LOWLEVEL_PREVIEW.h" #include "cusolver_common.h" #include "cusolverDn.h" #include "cusolverRf.h" -#if CUDA_VERSION >= 10010 -#include "cusolverMg.h" -#endif #include "cusolverSp.h" -#include "cusolverSp_LOWLEVEL_PREVIEW.h" - #endif // HEADERS_TEST_12_SOLVER_H diff --git a/tests/unit_tests/headers/headers_test_12_SOLVER_10010.cu b/tests/unit_tests/headers/headers_test_12_SOLVER_10010.cu new file mode 100644 index 00000000..a713913c --- /dev/null +++ b/tests/unit_tests/headers/headers_test_12_SOLVER_10010.cu @@ -0,0 +1,30 @@ +// RUN: %run_test hipify "%s" "%t" %hipify_args %clang_args + +// Checks that HIP header file is included after include guard controlling macro, +// which goes before #pragma once. +// CHECK: #ifndef HEADERS_TEST_12_SOLVER_H +// CHECK-NEXT: #include +#ifndef HEADERS_TEST_12_SOLVER_H +// CHECK: #pragma once +#pragma once +// CHECK-NOT: #include +#define HEADERS_TEST_12_SOLVER_H +#include +static int counter = 0; + +// CHECK: #include "hipsolver.h" +// CHECK-NOT: #include "hipsolver.h" +// CHECK-NOT: #include "cusolver_common.h" +// CHECK-NOT: #include "cusolverDn.h" +// CHECK-NOT: #include "cusolverRf.h" +// CHECK-NOT: #include "cusolverMg.h" +// CHECK-NOT: #include "cusolverSp.h" +// CHECK-NOT: #include "cusolverSp_LOWLEVEL_PREVIEW.h" +#include "cusolver_common.h" +#include "cusolverDn.h" +#include "cusolverRf.h" +#include "cusolverMg.h" +#include "cusolverSp.h" +#include "cusolverSp_LOWLEVEL_PREVIEW.h" + +#endif // HEADERS_TEST_12_SOLVER_H \ No newline at end of file diff --git a/tests/unit_tests/headers/headers_test_12_SOLVER_7050.cu b/tests/unit_tests/headers/headers_test_12_SOLVER_7050.cu new file mode 100644 index 00000000..3aa010aa --- /dev/null +++ b/tests/unit_tests/headers/headers_test_12_SOLVER_7050.cu @@ -0,0 +1,24 @@ +// RUN: %run_test hipify "%s" "%t" %hipify_args 1 --skip-excluded-preprocessor-conditional-blocks %clang_args + +#ifndef HEADERS_TEST_12_SOLVER_H +// CHECK: #pragma once +#pragma once +#define HEADERS_TEST_12_SOLVER_H +// CHECK: #include +// CHECK-NOT: #include +#include +static int counter = 0; + +// CHECK: #include "hipsolver.h" +// CHECK-NOT: #include "hipsolver.h" +// CHECK-NOT: #include "cusolver_common.h" +// CHECK-NOT: #include "cusolverDn.h" +// CHECK-NOT: #include "cusolverRf.h" +// CHECK-NOT: #include "cusolverSp.h" +// CHECK-NOT: #include "cusolverSp_LOWLEVEL_PREVIEW.h" +#include "cusolver_common.h" +#include "cusolverDn.h" +#include "cusolverRf.h" +#include "cusolverSp.h" +#include "cusolverSp_LOWLEVEL_PREVIEW.h" +#endif // HEADERS_TEST_12_SOLVER_H