SWDEV-418100 - Move nv headers to hipother repo

Change-Id: Ib54546e366b61bdb83789d8264f30f1bfb875605


[ROCm/clr commit: 67dda1ffd6]
Этот коммит содержится в:
Maneesh Gupta
2023-10-07 10:43:03 +00:00
родитель 90e078b5f4
Коммит 515ea1eb56
17 изменённых файлов: 10 добавлений и 4937 удалений
+4 -29
Просмотреть файл
@@ -43,7 +43,6 @@ list(APPEND CMAKE_MODULE_PATH ${HIP_COMMON_DIR}/cmake)
#############################
# Options
#############################
option(BUILD_HIPIFY_CLANG "Enable building the CUDA->HIP converter" OFF)
option(__HIP_ENABLE_PCH "Enable/Disable pre-compiled hip headers" ON)
option(HIP_OFFICIAL_BUILD "Enable/Disable for mainline/staging builds" OFF)
option(FILE_REORG_BACKWARD_COMPATIBILITY "Enable File Reorg with backward compatibility" OFF)
@@ -63,6 +62,7 @@ endif()
message(STATUS "HIPCC_BIN_DIR found at ${HIPCC_BIN_DIR}")
message(STATUS "HIP_COMMON_DIR found at ${HIP_COMMON_DIR}")
message(STATUS "HIPNV_DIR found at ${HIPNV_DIR}")
set(HIP_COMMON_INCLUDE_DIR ${HIP_COMMON_DIR}/include)
set(HIP_COMMON_BIN_DIR ${HIP_COMMON_DIR}/bin)
set(__HIPCONFIG_EXECUTABLE__ ${HIP_COMMON_DIR}/bin/hipconfig)
@@ -270,11 +270,6 @@ set(CONFIG_PACKAGE_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/hip)
set(CONFIG_LANG_PACKAGE_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/hip-lang)
set(CONFIG_RTC_PACKAGE_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/hiprtc)
# Build clang hipify if enabled
if (BUILD_HIPIFY_CLANG)
add_subdirectory(hipify-clang)
endif()
# Generate hip_version.h
set(_versionInfoHeader
"// Auto-generated by cmake\n
@@ -363,6 +358,9 @@ if(NOT ${INSTALL_SOURCE} EQUAL 0)
endif()
install(DIRECTORY include DESTINATION .)
if(DEFINED HIPNV_DIR)
install(DIRECTORY ${HIPNV_DIR}/include/hip/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hip/)
endif()
install(DIRECTORY ${HIP_COMMON_INCLUDE_DIR}/hip/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hip/)
if(WIN32)
install(DIRECTORY ${HIP_COMMON_DIR}/cmake DESTINATION .)
@@ -461,29 +459,6 @@ if(CLANGFORMAT_EXE)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()
#############################
# Testing steps
#############################
# HIT is not compatible with Windows
if(NOT WIN32)
set(HIP_ROOT_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(HIP_SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR})
if(HIP_PLATFORM STREQUAL "nvidia")
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/include" "${HIP_ROOT_DIR}/include" RESULT_VARIABLE COPY_COMMAND_OP ERROR_QUIET)
endif()
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_COMMON_INCLUDE_DIR}/hip/" "${HIP_ROOT_DIR}/include/hip/" RESULT_VARIABLE COPY_COMMAND_OP ERROR_QUIET)
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_COMMON_DIR}/cmake" "${HIP_ROOT_DIR}/cmake" RESULT_VARIABLE COPY_COMMAND_OP ERROR_QUIET)
if(${COPY_COMMAND_OP} EQUAL 0)
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_COMMON_BIN_DIR}" "${HIP_ROOT_DIR}/bin" RESULT_VARIABLE COPY_COMMAND_OP ERROR_QUIET)
endif()
file(COPY ${HIPCC_BIN_DIR}/hipcc DESTINATION ${HIP_ROOT_DIR}/bin/)
file(COPY ${HIPCC_BIN_DIR}/hipcc.pl DESTINATION ${HIP_ROOT_DIR}/bin/)
file(COPY ${HIPCC_BIN_DIR}/hipconfig DESTINATION ${HIP_ROOT_DIR}/bin/)
file(COPY ${HIPCC_BIN_DIR}/hipconfig.pl DESTINATION ${HIP_ROOT_DIR}/bin/)
file(COPY ${HIPCC_BIN_DIR}/hipvars.pm DESTINATION ${HIP_ROOT_DIR}/bin/)
endif()
#############################
# Code analysis
#############################
+1 -1
Просмотреть файл
@@ -88,7 +88,7 @@ function(generate_wrapper_header)
endforeach()
#find all header files from include/hip/nvidia_detail
file(GLOB include_files ${HIP_SRC_INC_DIR}/${HIP_NVIDIA_DETAIL_DIR}/*)
file(GLOB include_files ${HIPNV_DIR}/include/hip/${HIP_NVIDIA_DETAIL_DIR}/*)
#Convert the list of files into #includes
foreach(header_file ${include_files})
# set include guard
-1
Просмотреть файл
@@ -1 +0,0 @@
amd_detail
-1
Просмотреть файл
@@ -1 +0,0 @@
nvidia_detail
-28
Просмотреть файл
@@ -1,28 +0,0 @@
/*
Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef HIP_INCLUDE_HIP_NVIDIA_DETAIL_CHANNEL_DESCRIPTOR_H
#define HIP_INCLUDE_HIP_NVIDIA_DETAIL_CHANNEL_DESCRIPTOR_H
#include "channel_descriptor.h"
#endif
-67
Просмотреть файл
@@ -1,67 +0,0 @@
/*
Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef HIP_INCLUDE_HIP_NVIDIA_DETAIL_HIP_ATOMICS_H
#define HIP_INCLUDE_HIP_NVIDIA_DETAIL_HIP_ATOMICS_H
__device__ inline float atomicMax(float* addr, float val) {
int ret = __float_as_int(*addr);
while (val > __int_as_float(ret)) {
int old = ret;
if ((ret = atomicCAS((int *)addr, old, __float_as_int(val))) == old)
break;
}
return __int_as_float(ret);
}
__device__ inline double atomicMax(double* addr, double val) {
unsigned long long ret = __double_as_longlong(*addr);
while (val > __longlong_as_double(ret)) {
unsigned long long old = ret;
if ((ret = atomicCAS((unsigned long long *)addr, old, __double_as_longlong(val))) == old)
break;
}
return __longlong_as_double(ret);
}
__device__ inline float atomicMin(float* addr, float val) {
int ret = __float_as_int(*addr);
while (val < __int_as_float(ret)) {
int old = ret;
if ((ret = atomicCAS((int *)addr, old, __float_as_int(val))) == old)
break;
}
return __int_as_float(ret);
}
__device__ inline double atomicMin(double* addr, double val) {
unsigned long long ret = __double_as_longlong(*addr);
while (val < __longlong_as_double(ret)) {
unsigned long long old = ret;
if ((ret = atomicCAS((unsigned long long *)addr, old, __double_as_longlong(val))) == old)
break;
}
return __longlong_as_double(ret);
}
#endif
-32
Просмотреть файл
@@ -1,32 +0,0 @@
/*
Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef HIP_INCLUDE_HIP_NVIDIA_DETAIL_HIP_FP16_H
#define HIP_INCLUDE_HIP_NVIDIA_DETAIL_HIP_FP16_H
#include <cuda_bf16.h>
typedef struct __nv_bfloat16 __hip_bfloat16;
typedef struct __nv_bfloat162 __hip_bfloat162;
#endif // HIP_INCLUDE_HIP_NVIDIA_DETAIL_HIP_FP16_H
-119
Просмотреть файл
@@ -1,119 +0,0 @@
/*
Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef HIP_INCLUDE_HIP_NVIDIA_DETAIL_HIP_COMPLEX_H
#define HIP_INCLUDE_HIP_NVIDIA_DETAIL_HIP_COMPLEX_H
#include "cuComplex.h"
typedef cuFloatComplex hipFloatComplex;
__device__ __host__ static inline float hipCrealf(hipFloatComplex z) { return cuCrealf(z); }
__device__ __host__ static inline float hipCimagf(hipFloatComplex z) { return cuCimagf(z); }
__device__ __host__ static inline hipFloatComplex make_hipFloatComplex(float a, float b) {
return make_cuFloatComplex(a, b);
}
__device__ __host__ static inline hipFloatComplex hipConjf(hipFloatComplex z) { return cuConjf(z); }
__device__ __host__ static inline float hipCsqabsf(hipFloatComplex z) {
return cuCabsf(z) * cuCabsf(z);
}
__device__ __host__ static inline hipFloatComplex hipCaddf(hipFloatComplex p, hipFloatComplex q) {
return cuCaddf(p, q);
}
__device__ __host__ static inline hipFloatComplex hipCsubf(hipFloatComplex p, hipFloatComplex q) {
return cuCsubf(p, q);
}
__device__ __host__ static inline hipFloatComplex hipCmulf(hipFloatComplex p, hipFloatComplex q) {
return cuCmulf(p, q);
}
__device__ __host__ static inline hipFloatComplex hipCdivf(hipFloatComplex p, hipFloatComplex q) {
return cuCdivf(p, q);
}
__device__ __host__ static inline float hipCabsf(hipFloatComplex z) { return cuCabsf(z); }
typedef cuDoubleComplex hipDoubleComplex;
__device__ __host__ static inline double hipCreal(hipDoubleComplex z) { return cuCreal(z); }
__device__ __host__ static inline double hipCimag(hipDoubleComplex z) { return cuCimag(z); }
__device__ __host__ static inline hipDoubleComplex make_hipDoubleComplex(double a, double b) {
return make_cuDoubleComplex(a, b);
}
__device__ __host__ static inline hipDoubleComplex hipConj(hipDoubleComplex z) { return cuConj(z); }
__device__ __host__ static inline double hipCsqabs(hipDoubleComplex z) {
return cuCabs(z) * cuCabs(z);
}
__device__ __host__ static inline hipDoubleComplex hipCadd(hipDoubleComplex p, hipDoubleComplex q) {
return cuCadd(p, q);
}
__device__ __host__ static inline hipDoubleComplex hipCsub(hipDoubleComplex p, hipDoubleComplex q) {
return cuCsub(p, q);
}
__device__ __host__ static inline hipDoubleComplex hipCmul(hipDoubleComplex p, hipDoubleComplex q) {
return cuCmul(p, q);
}
__device__ __host__ static inline hipDoubleComplex hipCdiv(hipDoubleComplex p, hipDoubleComplex q) {
return cuCdiv(p, q);
}
__device__ __host__ static inline double hipCabs(hipDoubleComplex z) { return cuCabs(z); }
typedef cuFloatComplex hipComplex;
__device__ __host__ static inline hipComplex make_hipComplex(float x, float y) {
return make_cuComplex(x, y);
}
__device__ __host__ static inline hipFloatComplex hipComplexDoubleToFloat(hipDoubleComplex z) {
return cuComplexDoubleToFloat(z);
}
__device__ __host__ static inline hipDoubleComplex hipComplexFloatToDouble(hipFloatComplex z) {
return cuComplexFloatToDouble(z);
}
__device__ __host__ static inline hipComplex hipCfmaf(hipComplex p, hipComplex q, hipComplex r) {
return cuCfmaf(p, q, r);
}
__device__ __host__ static inline hipDoubleComplex hipCfma(hipDoubleComplex p, hipDoubleComplex q,
hipDoubleComplex r) {
return cuCfma(p, q, r);
}
#endif
-12
Просмотреть файл
@@ -1,12 +0,0 @@
#ifndef HIP_INCLUDE_HIP_NVIDIA_DETAIL_HIP_COOPERATIVE_GROUPS_H
#define HIP_INCLUDE_HIP_NVIDIA_DETAIL_HIP_COOPERATIVE_GROUPS_H
// Include CUDA headers
#include <cuda_runtime.h>
#include <cooperative_groups.h>
// Include HIP wrapper headers around CUDA
#include <hip/hip_runtime.h>
#include <hip/hip_runtime_api.h>
#endif // HIP_INCLUDE_HIP_NVIDIA_DETAIL_HIP_COOPERATIVE_GROUPS_H
-44
Просмотреть файл
@@ -1,44 +0,0 @@
/*
Copyright (c) 2015 - 2023 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef HIP_INCLUDE_NVIDIA_HIP_GL_INTEROP_H
#define HIP_INCLUDE_NVIDIA_HIP_GL_INTEROP_H
#include <cuda_gl_interop.h>
typedef enum cudaGLDeviceList hipGLDeviceList;
#define hipGLDeviceListAll cudaGLDeviceListAll
#define hipGLDeviceListCurrentFrame cudaGLDeviceListCurrentFrame
#define hipGLDeviceListNextFrame cudaGLDeviceListNextFrame
inline static hipError_t hipGLGetDevices(unsigned int* pHipDeviceCount, int* pHipDevices, unsigned int hipDeviceCount,
hipGLDeviceList deviceList) {
return hipCUDAErrorTohipError(cudaGLGetDevices(pHipDeviceCount, pHipDevices, hipDeviceCount, deviceList));
}
inline static hipError_t hipGraphicsGLRegisterBuffer(hipGraphicsResource** resource, GLuint buffer, unsigned int flags) {
return hipCUDAErrorTohipError(cudaGraphicsGLRegisterBuffer(resource, buffer, flags));
}
inline static hipError_t hipGraphicsGLRegisterImage(hipGraphicsResource** resource, GLuint image, GLenum target, unsigned int flags) {
return hipCUDAErrorTohipError(cudaGraphicsGLRegisterImage(resource, image, target, flags));
}
#endif
-126
Просмотреть файл
@@ -1,126 +0,0 @@
/*
Copyright (c) 2015 - 2023 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef NVIDIA_HIP_MATH_CONSTANTS_H
#define NVIDIA_HIP_MATH_CONSTANTS_H
#include <math_constants.h>
// single precision constants
#define HIP_INF_F CUDART_INF_F
#define HIP_NAN_F CUDART_NAN_F
#define HIP_MIN_DENORM_F CUDART_MIN_DENORM_F
#define HIP_MAX_NORMAL_F CUDART_MAX_NORMAL_F
#define HIP_NEG_ZERO_F CUDART_NEG_ZERO_F
#define HIP_ZERO_F CUDART_ZERO_F
#define HIP_ONE_F CUDART_ONE_F
#define HIP_SQRT_HALF_F CUDART_SQRT_HALF_F
#define HIP_SQRT_HALF_HI_F CUDART_SQRT_HALF_HI_F
#define HIP_SQRT_HALF_LO_F CUDART_SQRT_HALF_LO_F
#define HIP_SQRT_TWO_F CUDART_SQRT_TWO_F
#define HIP_THIRD_F CUDART_THIRD_F
#define HIP_PIO4_F CUDART_PIO4_F
#define HIP_PIO2_F CUDART_PIO2_F
#define HIP_3PIO4_F CUDART_3PIO4_F
#define HIP_2_OVER_PI_F CUDART_2_OVER_PI_F
#define HIP_SQRT_2_OVER_PI_F CUDART_SQRT_2_OVER_PI_F
#define HIP_PI_F CUDART_PI_F
#define HIP_L2E_F CUDART_L2E_F
#define HIP_L2T_F CUDART_L2T_F
#define HIP_LG2_F CUDART_LG2_F
#define HIP_LGE_F CUDART_LGE_F
#define HIP_LN2_F CUDART_LN2_F
#define HIP_LNT_F CUDART_LNT_F
#define HIP_LNPI_F CUDART_LNPI_F
#define HIP_TWO_TO_M126_F CUDART_TWO_TO_M126_F
#define HIP_TWO_TO_126_F CUDART_TWO_TO_126_F
#define HIP_NORM_HUGE_F CUDART_NORM_HUGE_F
#define HIP_TWO_TO_23_F CUDART_TWO_TO_23_F
#define HIP_TWO_TO_24_F CUDART_TWO_TO_24_F
#define HIP_TWO_TO_31_F CUDART_TWO_TO_31_F
#define HIP_TWO_TO_32_F CUDART_TWO_TO_32_F
#define HIP_REMQUO_BITS_F CUDART_REMQUO_BITS_F
#define HIP_REMQUO_MASK_F CUDART_REMQUO_MASK_F
#define HIP_TRIG_PLOSS_F CUDART_TRIG_PLOSS_F
// double precision constants
#define HIP_INF CUDART_INF
#define HIP_NAN CUDART_NAN
#define HIP_NEG_ZERO CUDART_NEG_ZERO
#define HIP_MIN_DENORM CUDART_MIN_DENORM
#define HIP_ZERO CUDART_ZERO
#define HIP_ONE CUDART_ONE
#define HIP_SQRT_TWO CUDART_SQRT_TWO
#define HIP_SQRT_HALF CUDART_SQRT_HALF
#define HIP_SQRT_HALF_HI CUDART_SQRT_HALF_HI
#define HIP_SQRT_HALF_LO CUDART_SQRT_HALF_LO
#define HIP_THIRD CUDART_THIRD
#define HIP_TWOTHIRD CUDART_TWOTHIRD
#define HIP_PIO4 CUDART_PIO4
#define HIP_PIO4_HI CUDART_PIO4_HI
#define HIP_PIO4_LO CUDART_PIO4_LO
#define HIP_PIO2 CUDART_PIO2
#define HIP_PIO2_HI CUDART_PIO2_HI
#define HIP_PIO2_LO CUDART_PIO2_LO
#define HIP_3PIO4 CUDART_3PIO4
#define HIP_2_OVER_PI CUDART_2_OVER_PI
#define HIP_PI CUDART_PI
#define HIP_PI_HI CUDART_PI_HI
#define HIP_PI_LO CUDART_PI_LO
#define HIP_SQRT_2PI CUDART_SQRT_2PI
#define HIP_SQRT_2PI_HI CUDART_SQRT_2PI_HI
#define HIP_SQRT_2PI_LO CUDART_SQRT_2PI_LO
#define HIP_SQRT_PIO2 CUDART_SQRT_PIO2
#define HIP_SQRT_PIO2_HI CUDART_SQRT_PIO2_HI
#define HIP_SQRT_PIO2_LO CUDART_SQRT_PIO2_LO
#define HIP_SQRT_2OPI CUDART_SQRT_2OPI
#define HIP_L2E CUDART_L2E
#define HIP_L2E_HI CUDART_L2E_HI
#define HIP_L2E_LO CUDART_L2E_LO
#define HIP_L2T CUDART_L2T
#define HIP_LG2 CUDART_LG2
#define HIP_LG2_HI CUDART_LG2_HI
#define HIP_LG2_LO CUDART_LG2_LO
#define HIP_LGE CUDART_LGE
#define HIP_LGE_HI CUDART_LGE_HI
#define HIP_LGE_LO CUDART_LGE_LO
#define HIP_LN2 CUDART_LN2
#define HIP_LN2_HI CUDART_LN2_HI
#define HIP_LN2_LO CUDART_LN2_LO
#define HIP_LNT CUDART_LNT
#define HIP_LNT_HI CUDART_LNT_HI
#define HIP_LNT_LO CUDART_LNT_LO
#define HIP_LNPI CUDART_LNPI
#define HIP_LN2_X_1024 CUDART_LN2_X_1024
#define HIP_LN2_X_1025 CUDART_LN2_X_1025
#define HIP_LN2_X_1075 CUDART_LN2_X_1075
#define HIP_LG2_X_1024 CUDART_LG2_X_1024
#define HIP_LG2_X_1075 CUDART_LG2_X_1075
#define HIP_TWO_TO_23 CUDART_TWO_TO_23
#define HIP_TWO_TO_52 CUDART_TWO_TO_52
#define HIP_TWO_TO_53 CUDART_TWO_TO_53
#define HIP_TWO_TO_54 CUDART_TWO_TO_54
#define HIP_TWO_TO_M54 CUDART_TWO_TO_M54
#define HIP_TWO_TO_M1022 CUDART_TWO_TO_M1022
#define HIP_TRIG_PLOSS CUDART_TRIG_PLOSS
#define HIP_DBL2INT_CVT CUDART_DBL2INT_CVT
#endif
-124
Просмотреть файл
@@ -1,124 +0,0 @@
/*
Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef HIP_INCLUDE_HIP_NVIDIA_DETAIL_HIP_RUNTIME_H
#define HIP_INCLUDE_HIP_NVIDIA_DETAIL_HIP_RUNTIME_H
#include <cuda_runtime.h>
#include <hip/hip_runtime_api.h>
#define HIP_KERNEL_NAME(...) __VA_ARGS__
typedef int hipLaunchParm;
#define hipLaunchKernelGGLInternal(kernelName, numBlocks, numThreads, memPerBlock, streamId, ...) \
do { \
kernelName<<<numBlocks, numThreads, memPerBlock, streamId>>>(__VA_ARGS__); \
} while (0)
#define hipLaunchKernelGGL(kernelName, ...) hipLaunchKernelGGLInternal((kernelName), __VA_ARGS__)
#define hipReadModeElementType cudaReadModeElementType
#ifdef __CUDA_ARCH__
// 32-bit Atomics:
#define __HIP_ARCH_HAS_GLOBAL_INT32_ATOMICS__ (__CUDA_ARCH__ >= 110)
#define __HIP_ARCH_HAS_GLOBAL_FLOAT_ATOMIC_EXCH__ (__CUDA_ARCH__ >= 110)
#define __HIP_ARCH_HAS_SHARED_INT32_ATOMICS__ (__CUDA_ARCH__ >= 120)
#define __HIP_ARCH_HAS_SHARED_FLOAT_ATOMIC_EXCH__ (__CUDA_ARCH__ >= 120)
#define __HIP_ARCH_HAS_FLOAT_ATOMIC_ADD__ (__CUDA_ARCH__ >= 200)
// 64-bit Atomics:
#define __HIP_ARCH_HAS_GLOBAL_INT64_ATOMICS__ (__CUDA_ARCH__ >= 200)
#define __HIP_ARCH_HAS_SHARED_INT64_ATOMICS__ (__CUDA_ARCH__ >= 120)
// Doubles
#define __HIP_ARCH_HAS_DOUBLES__ (__CUDA_ARCH__ >= 120)
// warp cross-lane operations:
#define __HIP_ARCH_HAS_WARP_VOTE__ (__CUDA_ARCH__ >= 120)
#define __HIP_ARCH_HAS_WARP_BALLOT__ (__CUDA_ARCH__ >= 200)
#define __HIP_ARCH_HAS_WARP_SHUFFLE__ (__CUDA_ARCH__ >= 300)
#define __HIP_ARCH_HAS_WARP_FUNNEL_SHIFT__ (__CUDA_ARCH__ >= 350)
// sync
#define __HIP_ARCH_HAS_THREAD_FENCE_SYSTEM__ (__CUDA_ARCH__ >= 200)
#define __HIP_ARCH_HAS_SYNC_THREAD_EXT__ (__CUDA_ARCH__ >= 200)
// misc
#define __HIP_ARCH_HAS_SURFACE_FUNCS__ (__CUDA_ARCH__ >= 200)
#define __HIP_ARCH_HAS_3DGRID__ (__CUDA_ARCH__ >= 200)
#define __HIP_ARCH_HAS_DYNAMIC_PARALLEL__ (__CUDA_ARCH__ >= 350)
#endif
#ifdef __CUDACC__
#include "nvidia_hip_atomics.h"
#include "nvidia_hip_unsafe_atomics.h"
#define hipThreadIdx_x threadIdx.x
#define hipThreadIdx_y threadIdx.y
#define hipThreadIdx_z threadIdx.z
#define hipBlockIdx_x blockIdx.x
#define hipBlockIdx_y blockIdx.y
#define hipBlockIdx_z blockIdx.z
#define hipBlockDim_x blockDim.x
#define hipBlockDim_y blockDim.y
#define hipBlockDim_z blockDim.z
#define hipGridDim_x gridDim.x
#define hipGridDim_y gridDim.y
#define hipGridDim_z gridDim.z
#define HIP_SYMBOL(X) &X
/**
* Map HIP_DYNAMIC_SHARED to "extern __shared__" for compatibility with old HIP applications
* To be removed in a future release.
*/
#define HIP_DYNAMIC_SHARED(type, var) extern __shared__ type var[];
#define HIP_DYNAMIC_SHARED_ATTRIBUTE
#ifdef __HIP_DEVICE_COMPILE__
#define abort_() \
{ asm("trap;"); }
#undef assert
#define assert(COND) \
{ \
if (!COND) { \
abort_(); \
} \
}
#endif
#define __clock() clock()
#define __clock64() clock64()
#endif
#endif
Разница между файлами не показана из-за своего большого размера Загрузить разницу
-6
Просмотреть файл
@@ -1,6 +0,0 @@
#ifndef HIP_INCLUDE_HIP_NVIDIA_DETAIL_HIP_TEXTURE_TYPES_H
#define HIP_INCLUDE_HIP_NVIDIA_DETAIL_HIP_TEXTURE_TYPES_H
#include <texture_types.h>
#endif
-100
Просмотреть файл
@@ -1,100 +0,0 @@
/*
Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef HIP_INCLUDE_HIP_NVIDIA_DETAIL_HIP_UNSAFE_ATOMICS_H
#define HIP_INCLUDE_HIP_NVIDIA_DETAIL_HIP_UNSAFE_ATOMICS_H
__device__ inline float unsafeAtomicAdd(float* addr, float value) {
return atomicAdd(addr, value);
}
__device__ inline double unsafeAtomicAdd(double* addr, double value) {
#if __CUDA_ARCH__ < 600
unsigned long long *addr_cast = (unsigned long long*)addr;
unsigned long long old_val = *addr_cast;
unsigned long long expected;
do {
expected = old_val;
old_val = atomicCAS(addr_cast, expected,
__double_as_longlong(value +
__longlong_as_double(expected)));
} while (__double_as_longlong(expected) != __double_as_longlong(old_val));
return old_val;
#else
return atomicAdd(addr, value);
#endif
}
__device__ inline float unsafeAtomicMax(float* addr, float value) {
return atomicMax(addr, value);
}
__device__ inline double unsafeAtomicMax(double* addr, double val) {
return atomicMax(addr, val);
}
__device__ inline float unsafeAtomicMin(float* addr, float value) {
return atomicMin(addr, value);
}
__device__ inline double unsafeAtomicMin(double* addr, double val) {
return atomicMin(addr, val);
}
__device__ inline float safeAtomicAdd(float* addr, float value) {
return atomicAdd(addr, value);
}
__device__ inline double safeAtomicAdd(double* addr, double value) {
#if __CUDA_ARCH__ < 600
unsigned long long *addr_cast = (unsigned long long*)addr;
unsigned long long old_val = *addr_cast;
unsigned long long expected;
do {
expected = old_val;
old_val = atomicCAS(addr_cast, expected,
__double_as_longlong(value +
__longlong_as_double(expected)));
} while (__double_as_longlong(expected) != __double_as_longlong(old_val));
return old_val;
#else
return atomicAdd(addr, value);
#endif
}
__device__ inline float safeAtomicMax(float* addr, float value) {
return atomicMax(addr, value);
}
__device__ inline double safeAtomicMax(double* addr, double val) {
return atomicMax(addr, val);
}
__device__ inline float safeAtomicMin(float* addr, float value) {
return atomicMin(addr, value);
}
__device__ inline double safeAtomicMin(double* addr, double val) {
return atomicMin(addr, val);
}
#endif
-172
Просмотреть файл
@@ -1,172 +0,0 @@
/*
Copyright (c) 2021 - 2022 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef HIPRTC_H
#define HIPRTC_H
#include <cuda.h>
#include <nvrtc.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <stdlib.h>
#if !defined(_WIN32)
#pragma GCC visibility push(default)
#endif
typedef enum hiprtcResult {
HIPRTC_SUCCESS = 0,
HIPRTC_ERROR_OUT_OF_MEMORY = 1,
HIPRTC_ERROR_PROGRAM_CREATION_FAILURE = 2,
HIPRTC_ERROR_INVALID_INPUT = 3,
HIPRTC_ERROR_INVALID_PROGRAM = 4,
HIPRTC_ERROR_INVALID_OPTION = 5,
HIPRTC_ERROR_COMPILATION = 6,
HIPRTC_ERROR_BUILTIN_OPERATION_FAILURE = 7,
HIPRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION = 8,
HIPRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION = 9,
HIPRTC_ERROR_NAME_EXPRESSION_NOT_VALID = 10,
HIPRTC_ERROR_INTERNAL_ERROR = 11
} hiprtcResult;
inline static nvrtcResult hiprtcResultTonvrtcResult(hiprtcResult result) {
switch (result) {
case HIPRTC_SUCCESS:
return NVRTC_SUCCESS;
case HIPRTC_ERROR_OUT_OF_MEMORY:
return NVRTC_ERROR_OUT_OF_MEMORY;
case HIPRTC_ERROR_PROGRAM_CREATION_FAILURE:
return NVRTC_ERROR_PROGRAM_CREATION_FAILURE;
case HIPRTC_ERROR_INVALID_INPUT:
return NVRTC_ERROR_INVALID_INPUT;
case HIPRTC_ERROR_INVALID_PROGRAM:
return NVRTC_ERROR_INVALID_PROGRAM;
case HIPRTC_ERROR_INVALID_OPTION:
return NVRTC_ERROR_INVALID_OPTION;
case HIPRTC_ERROR_COMPILATION:
return NVRTC_ERROR_COMPILATION;
case HIPRTC_ERROR_BUILTIN_OPERATION_FAILURE:
return NVRTC_ERROR_BUILTIN_OPERATION_FAILURE;
case HIPRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION:
return NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION;
case HIPRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION:
return NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION;
case HIPRTC_ERROR_NAME_EXPRESSION_NOT_VALID:
return NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID;
case HIPRTC_ERROR_INTERNAL_ERROR:
return NVRTC_ERROR_INTERNAL_ERROR;
default:
return NVRTC_ERROR_INTERNAL_ERROR;
}
}
inline static hiprtcResult nvrtcResultTohiprtcResult(nvrtcResult result) {
switch (result) {
case NVRTC_SUCCESS:
return HIPRTC_SUCCESS;
case NVRTC_ERROR_OUT_OF_MEMORY:
return HIPRTC_ERROR_OUT_OF_MEMORY;
case NVRTC_ERROR_PROGRAM_CREATION_FAILURE:
return HIPRTC_ERROR_PROGRAM_CREATION_FAILURE;
case NVRTC_ERROR_INVALID_INPUT:
return HIPRTC_ERROR_INVALID_INPUT;
case NVRTC_ERROR_INVALID_PROGRAM:
return HIPRTC_ERROR_INVALID_PROGRAM;
case NVRTC_ERROR_INVALID_OPTION:
return HIPRTC_ERROR_INVALID_OPTION;
case NVRTC_ERROR_COMPILATION:
return HIPRTC_ERROR_COMPILATION;
case NVRTC_ERROR_BUILTIN_OPERATION_FAILURE:
return HIPRTC_ERROR_BUILTIN_OPERATION_FAILURE;
case NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION:
return HIPRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION;
case NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION:
return HIPRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION;
case NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID:
return HIPRTC_ERROR_NAME_EXPRESSION_NOT_VALID;
case NVRTC_ERROR_INTERNAL_ERROR:
return HIPRTC_ERROR_INTERNAL_ERROR;
default:
return HIPRTC_ERROR_INTERNAL_ERROR;
}
}
inline static const char* hiprtcGetErrorString(hiprtcResult result) {
return nvrtcGetErrorString(hiprtcResultTonvrtcResult(result));
}
inline static hiprtcResult hiprtcVersion(int* major, int* minor) {
return nvrtcResultTohiprtcResult(nvrtcVersion(major, minor));
}
typedef nvrtcProgram hiprtcProgram;
inline static hiprtcResult hiprtcAddNameExpression(hiprtcProgram prog, const char* name_expression) {
return nvrtcResultTohiprtcResult(nvrtcAddNameExpression(prog, name_expression));
}
inline static hiprtcResult hiprtcCompileProgram(hiprtcProgram prog, int numOptions, const char** options) {
return nvrtcResultTohiprtcResult(nvrtcCompileProgram(prog, numOptions, options));
}
inline static hiprtcResult hiprtcCreateProgram(hiprtcProgram* prog, const char* src, const char* name,
int numHeaders, const char** headers, const char** includeNames) {
return nvrtcResultTohiprtcResult(
nvrtcCreateProgram(prog, src, name, numHeaders, headers, includeNames));
}
inline static hiprtcResult hiprtcDestroyProgram(hiprtcProgram* prog) {
return nvrtcResultTohiprtcResult(nvrtcDestroyProgram(prog));
}
inline static hiprtcResult hiprtcGetLoweredName(hiprtcProgram prog, const char* name_expression,
const char** lowered_name) {
return nvrtcResultTohiprtcResult(nvrtcGetLoweredName(prog, name_expression, lowered_name));
}
inline static hiprtcResult hiprtcGetProgramLog(hiprtcProgram prog, char* log) {
return nvrtcResultTohiprtcResult(nvrtcGetProgramLog(prog, log));
}
inline static hiprtcResult hiprtcGetProgramLogSize(hiprtcProgram prog, size_t* logSizeRet) {
return nvrtcResultTohiprtcResult(nvrtcGetProgramLogSize(prog, logSizeRet));
}
inline static hiprtcResult hiprtcGetCode(hiprtcProgram prog, char* code) {
return nvrtcResultTohiprtcResult(nvrtcGetPTX(prog, code));
}
inline static hiprtcResult hiprtcGetCodeSize(hiprtcProgram prog, size_t* codeSizeRet) {
return nvrtcResultTohiprtcResult(nvrtcGetPTXSize(prog, codeSizeRet));
}
#if !defined(_WIN32)
#pragma GCC visibility pop
#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif // HIPRTC_H
+5 -1
Просмотреть файл
@@ -90,10 +90,14 @@ install(DIRECTORY ${hip_SOURCE_DIR}/bin DESTINATION . COMPONENT dev
install(DIRECTORY ${HIP_COMMON_DIR}/include DESTINATION . COMPONENT dev)
install(DIRECTORY ${hip_SOURCE_DIR}/include/hip/amd_detail
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hip COMPONENT dev)
install(DIRECTORY ${hip_SOURCE_DIR}/include/hip/nvidia_detail
if(DEFINED HIPNV_DIR)
install(DIRECTORY ${HIPNV_DIR}/include/hip/nvidia_detail
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hip COMPONENT dev)
endif()
if(HIP_PLATFORM STREQUAL "amd" )
install(FILES ${CMAKE_BINARY_DIR}/hipamd/include/hip/amd_detail/hip_prof_str.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hip/amd_detail COMPONENT dev)
endif()
install(FILES ${CMAKE_BINARY_DIR}/hipamd/include/hip/hip_version.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hip COMPONENT dev)
install(FILES ${CMAKE_BINARY_DIR}/hipamd/share/hip/version DESTINATION ${CMAKE_INSTALL_DATADIR}/hip COMPONENT dev)