Skip to content

Commit

Permalink
merge amd-mainline into rocm-rel-5.3
Browse files Browse the repository at this point in the history
Change-Id: Ia2120bb38526f8cd864762faba4b24f9d0458217
  • Loading branch information
searlmc1 committed Aug 22, 2022
2 parents 3b6d104 + dfdd3b8 commit 4b32c52
Show file tree
Hide file tree
Showing 26 changed files with 3,194 additions and 3,224 deletions.
199 changes: 101 additions & 98 deletions README.md

Large diffs are not rendered by default.

727 changes: 299 additions & 428 deletions bin/hipify-perl

Large diffs are not rendered by default.

320 changes: 160 additions & 160 deletions doc/markdown/CUDA_Driver_API_functions_supported_by_HIP.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/markdown/CUDA_RTC_API_supported_by_HIP.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CUDA_RTC_API_supported_by_HIP API supported by HIP
# CUDA RTC API supported by HIP

## **1. RTC Data types**

Expand Down
180 changes: 90 additions & 90 deletions doc/markdown/CUDA_Runtime_API_functions_supported_by_HIP.md

Large diffs are not rendered by default.

166 changes: 84 additions & 82 deletions src/CUDA2HIP_Driver_API_functions.cpp

Large diffs are not rendered by default.

243 changes: 123 additions & 120 deletions src/CUDA2HIP_Driver_API_types.cpp

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/CUDA2HIP_Perl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ namespace perl {
void generateExperimentalSubstitutions(unique_ptr<ostream> &streamPtr) {
*streamPtr.get() << endl << sub << sExperimentalSubstitutions << " {" << endl;
for (int i = 0; i < NUM_CONV_TYPES; ++i) {
if (i == CONV_INCLUDE_CUDA_MAIN_H || i == CONV_INCLUDE) {
if (i == CONV_INCLUDE_CUDA_MAIN_H || i == CONV_INCLUDE_CUDA_MAIN_V2_H || i == CONV_INCLUDE) {
for (auto &ma : CUDA_INCLUDE_MAP) {
if (!Statistics::isHipExperimental(ma.second)) continue;
if (i == ma.second.type) {
Expand Down Expand Up @@ -373,7 +373,7 @@ namespace perl {
bool bTranslateToRoc = TranslateToRoc;
TranslateToRoc = true;
for (int i = 0; i < NUM_CONV_TYPES; ++i) {
if (i == CONV_INCLUDE_CUDA_MAIN_H) {
if (i == CONV_INCLUDE_CUDA_MAIN_H || i == CONV_INCLUDE_CUDA_MAIN_V2_H) {
for (auto &ma : CUDA_INCLUDE_MAP) {
if (i == ma.second.type) {
string sCUDA = ma.first.str();
Expand All @@ -400,7 +400,7 @@ namespace perl {
void generateSimpleSubstitutions(unique_ptr<ostream> &streamPtr) {
*streamPtr.get() << endl << sub << sSimpleSubstitutions << " {" << endl;
for (int i = 0; i < NUM_CONV_TYPES; ++i) {
if (i == CONV_INCLUDE_CUDA_MAIN_H || i == CONV_INCLUDE) {
if (i == CONV_INCLUDE_CUDA_MAIN_H || i == CONV_INCLUDE_CUDA_MAIN_V2_H || i == CONV_INCLUDE) {
for (auto &ma : CUDA_INCLUDE_MAP) {
if (Statistics::isUnsupported(ma.second) || Statistics::isHipExperimental(ma.second)) continue;
if (i == ma.second.type) {
Expand Down
118 changes: 64 additions & 54 deletions src/CUDA2HIP_Runtime_API_functions.cpp

Large diffs are not rendered by default.

217 changes: 115 additions & 102 deletions src/CUDA2HIP_Runtime_API_types.cpp

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/Statistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ std::string Statistics::getHipVersion(const hipVersions& ver) {
case HIP_5010: return "5.1.0";
case HIP_5011: return "5.1.1";
case HIP_5020: return "5.2.0";
case HIP_5030: return "5.3.0";
}
return "";
}
Expand Down
3 changes: 2 additions & 1 deletion src/Statistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ enum hipVersions {
HIP_5010 = 5010,
HIP_5011 = 5011,
HIP_5020 = 5020,
HIP_LATEST = HIP_5020,
HIP_5030 = 5030,
HIP_LATEST = HIP_5030,
};

struct cudaAPIversions {
Expand Down
6 changes: 6 additions & 0 deletions tests/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ if config.cuda_version_major < 9:
config.excludes.append('cuSPARSE_07.cu')
config.excludes.append('benchmark_curand_kernel.cpp')
config.excludes.append('reinterpret_cast.cu')
config.excludes.append('cub_01.cu')
config.excludes.append('cub_02.cu')
config.excludes.append('cub_03.cu')
if config.cuda_version_major < 10:
config.excludes.append('cuSPARSE_08.cu')
config.excludes.append('cuSPARSE_09.cu')
Expand All @@ -76,6 +79,9 @@ if config.cuda_version_major > 10:
config.excludes.append('cuSPARSE_02.cu')
config.excludes.append('cuSPARSE_12.cu')

if config.cuda_version_major < 11 or (config.cuda_version_major == 11 and config.cuda_version_minor < 1):
config.excludes.append('runtime_functions_11010.cu')

# name: The name of this test suite.
config.name = 'hipify'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %run_test hipify "%s" "%t" --skip-excluded-preprocessor-conditional-blocks %hipify_args %clang_args
// RUN: %run_test hipify "%s" "%t" %hipify_args 2 --hip-kernel-execution-syntax --skip-excluded-preprocessor-conditional-blocks %clang_args

#include <iomanip>
#include <iostream>
Expand Down
31 changes: 16 additions & 15 deletions tests/unit_tests/synthetic/driver_defines.cu
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ int main() {
// CHECK: #define __HIPCC__;
#define __CUDACC__;

#if CUDA_VERSION > 7050
// CHECK: int DEVICE_CPU = hipCpuDeviceId;
// CHECK-NEXT: int DEVICE_INVALID = hipInvalidDeviceId;
int DEVICE_CPU = CU_DEVICE_CPU;
int DEVICE_INVALID = CU_DEVICE_INVALID;
#endif

// CHECK: int IPC_HANDLE_SIZE = HIP_IPC_HANDLE_SIZE;
int IPC_HANDLE_SIZE = CU_IPC_HANDLE_SIZE;

Expand All @@ -37,10 +30,6 @@ int main() {
int MEMHOSTALLOC_WRITECOMBINED = CU_MEMHOSTALLOC_WRITECOMBINED;
int MEMHOSTREGISTER_PORTABLE = CU_MEMHOSTREGISTER_PORTABLE;
int MEMHOSTREGISTER_DEVICEMAP = CU_MEMHOSTREGISTER_DEVICEMAP;
#if CUDA_VERSION > 7000
// CHECK: int MEMHOSTREGISTER_IOMEMORY = hipHostRegisterIoMemory;
int MEMHOSTREGISTER_IOMEMORY = CU_MEMHOSTREGISTER_IOMEMORY;
#endif

// CHECK: int TRSA_OVERRIDE_FORMAT = HIP_TRSA_OVERRIDE_FORMAT;
// CHECK-NEXT: int TRSF_NORMALIZED_COORDINATES = HIP_TRSF_NORMALIZED_COORDINATES;
Expand All @@ -60,15 +49,27 @@ int main() {
int ARRAY3D_CUBEMAP = CUDA_ARRAY3D_CUBEMAP;
int ARRAY3D_TEXTURE_GATHER = CUDA_ARRAY3D_TEXTURE_GATHER;

#if CUDA_VERSION > 8000
// CHECK: hipStream_t STREAM_PER_THREAD = hipStreamPerThread;
CUstream STREAM_PER_THREAD = CU_STREAM_PER_THREAD;

#if CUDA_VERSION >= 7050
// CHECK: int MEMHOSTREGISTER_IOMEMORY = hipHostRegisterIoMemory;
int MEMHOSTREGISTER_IOMEMORY = CU_MEMHOSTREGISTER_IOMEMORY;
#endif

#if CUDA_VERSION >= 8000
// CHECK: int DEVICE_CPU = hipCpuDeviceId;
// CHECK-NEXT: int DEVICE_INVALID = hipInvalidDeviceId;
int DEVICE_CPU = CU_DEVICE_CPU;
int DEVICE_INVALID = CU_DEVICE_INVALID;
#endif

#if CUDA_VERSION >= 9000
// CHECK: int COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC = hipCooperativeLaunchMultiDeviceNoPreSync;
// CHECK-NEXT: int COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC = hipCooperativeLaunchMultiDeviceNoPostSync;
int COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC = CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC;
int COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC = CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC;
#endif

// CHECK: hipStream_t STREAM_PER_THREAD = hipStreamPerThread;
CUstream STREAM_PER_THREAD = CU_STREAM_PER_THREAD;

return 0;
}
Loading

0 comments on commit 4b32c52

Please sign in to comment.