Skip to content

Commit

Permalink
Merge pull request ROCm#1271 from emankov/HIPIFY
Browse files Browse the repository at this point in the history
[HIPIFY][tests][fix] Split the test `headers/headers_test_12_SOLVER.cu`
  • Loading branch information
emankov authored Jan 9, 2024
2 parents 0b74090 + 9aa7ea3 commit cf6504b
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 6 deletions.
4 changes: 4 additions & 0 deletions tests/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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')
Expand Down
6 changes: 0 additions & 6 deletions tests/unit_tests/headers/headers_test_12_SOLVER.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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
30 changes: 30 additions & 0 deletions tests/unit_tests/headers/headers_test_12_SOLVER_10010.cu
Original file line number Diff line number Diff line change
@@ -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 <hip/hip_runtime.h>
#ifndef HEADERS_TEST_12_SOLVER_H
// CHECK: #pragma once
#pragma once
// CHECK-NOT: #include <hip/hip_runtime.h>
#define HEADERS_TEST_12_SOLVER_H
#include <stdio.h>
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
24 changes: 24 additions & 0 deletions tests/unit_tests/headers/headers_test_12_SOLVER_7050.cu
Original file line number Diff line number Diff line change
@@ -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 <hip/hip_runtime.h>
// CHECK-NOT: #include <cuda_runtime.h>
#include <cuda_runtime.h>
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

0 comments on commit cf6504b

Please sign in to comment.