@@ -22,7 +22,6 @@ THE SOFTWARE.
22
22
#pragma once
23
23
24
24
#include <hip/hip_common.h>
25
- #include <hip/linker_types.h>
26
25
27
26
#if !defined(__HIP_PLATFORM_AMD__ ) && defined(__HIP_PLATFORM_NVIDIA__ )
28
27
#include <hip/nvidia_detail/nvidia_hiprtc.h>
@@ -42,7 +41,7 @@ extern "C" {
42
41
*
43
42
* @addtogroup GlobalDefs
44
43
* @{
45
- *
44
+ *
46
45
*/
47
46
/**
48
47
* hiprtc error code
@@ -57,90 +56,66 @@ typedef enum hiprtcResult {
57
56
HIPRTC_ERROR_COMPILATION = 6 , ///< Compilation error
58
57
HIPRTC_ERROR_BUILTIN_OPERATION_FAILURE = 7 , ///< Failed in builtin operation
59
58
HIPRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION = 8 , ///< No name expression after compilation
60
- HIPRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION = 9 , ///< No lowered names before compilation
59
+ HIPRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION = 9 , ///< No lowered names before compilation
61
60
HIPRTC_ERROR_NAME_EXPRESSION_NOT_VALID = 10 , ///< Invalid name expression
62
61
HIPRTC_ERROR_INTERNAL_ERROR = 11 , ///< Internal error
63
62
HIPRTC_ERROR_LINKING = 100 ///< Error in linking
64
63
} hiprtcResult ;
64
+
65
65
/**
66
66
* hiprtc JIT option
67
67
*/
68
- #define hiprtcJIT_option hipJitOption
69
- #define HIPRTC_JIT_MAX_REGISTERS hipJitOptionMaxRegisters ///< CUDA Only Maximum registers may be used in a
70
- ///< thread, passed to compiler
71
- #define HIPRTC_JIT_THREADS_PER_BLOCK hipJitOptionThreadsPerBlock ///< CUDA Only Number of thread per block
72
- #define HIPRTC_JIT_WALL_TIME hipJitOptionWallTime ///< CUDA Only Value for total wall clock time
73
- #define HIPRTC_JIT_INFO_LOG_BUFFER hipJitOptionInfoLogBuffer ///< CUDA Only Pointer to the buffer with
74
- ///< logged information
75
- #define HIPRTC_JIT_INFO_LOG_BUFFER_SIZE_BYTES hipJitOptionInfoLogBufferSizeBytes ///< CUDA Only Size of the buffer
76
- ///< in bytes for logged info
77
- #define HIPRTC_JIT_ERROR_LOG_BUFFER hipJitOptionErrorLogBuffer ///< CUDA Only Pointer to the buffer
78
- ///< with logged error(s)
79
- #define HIPRTC_JIT_ERROR_LOG_BUFFER_SIZE_BYTES hipJitOptionErrorLogBufferSizeBytes ///< CUDA Only Size of the buffer in
80
- ///< bytes for logged error(s)
81
- #define HIPRTC_JIT_OPTIMIZATION_LEVEL hipJitOptionOptimizationLevel ///< Value of optimization level for
82
- ///< generated codes, acceptable
83
- ///< options -O0, -O1, -O2, -O3
84
- #define HIPRTC_JIT_TARGET_FROM_HIPCONTEXT hipJitOptionTargetFromContext ///< CUDA Only The target context,
85
- ///< which is the default
86
- #define HIPRTC_JIT_TARGET hipJitOptionTarget ///< CUDA Only JIT target
87
- #define HIPRTC_JIT_FALLBACK_STRATEGY hipJitOptionFallbackStrategy ///< CUDA Only Fallback strategy
88
- #define HIPRTC_JIT_GENERATE_DEBUG_INFO hipJitOptionGenerateDebugInfo ///< CUDA Only Generate debug information
89
- #define HIPRTC_JIT_LOG_VERBOSE hipJitOptionLogVerbose ///< CUDA Only Generate log verbose
90
- #define HIPRTC_JIT_GENERATE_LINE_INFO hipJitOptionGenerateLineInfo ///< CUDA Only Generate line number information
91
- #define HIPRTC_JIT_CACHE_MODE hipJitOptionCacheMode ///< CUDA Only Set cache mode
92
- #define HIPRTC_JIT_NEW_SM3X_OPT hipJitOptionSm3xOpt ///< @deprecated CUDA Only New SM3X option.
93
- #define HIPRTC_JIT_FAST_COMPILE hipJitOptionFastCompile ///< CUDA Only Set fast compile
94
- #define HIPRTC_JIT_GLOBAL_SYMBOL_NAMES hipJitOptionGlobalSymbolNames ///< CUDA Only Array of device symbol names to be
95
- ///< relocated to the host
96
- #define HIPRTC_JIT_GLOBAL_SYMBOL_ADDRESS hipJitOptionGlobalSymbolAddresses ///< CUDA Only Array of host addresses to be
97
- ///< relocated to the device
98
- #define HIPRTC_JIT_GLOBAL_SYMBOL_COUNT hipJitOptionGlobalSymbolCount ///< CUDA Only Number of symbol count.
99
- #define HIPRTC_JIT_LTO hipJitOptionLto ///< @deprecated CUDA Only Enable link-time
100
- ///< optimization for device code
101
- #define HIPRTC_JIT_FTZ hipJitOptionFtz ///< @deprecated CUDA Only Set
102
- ///< single-precision denormals.
103
- #define HIPRTC_JIT_PREC_DIV hipJitOptionPrecDiv ///< @deprecated CUDA Only Set
104
- ///< single-precision floating-point division
105
- ///< and reciprocals
106
- #define HIPRTC_JIT_PREC_SQRT hipJitOptionPrecSqrt ///< @deprecated CUDA Only Set
107
- ///< single-precision floating-point
108
- ///< square root
109
- #define HIPRTC_JIT_FMA hipJitOptionFma ///< @deprecated CUDA Only Enable
110
- ///< floating-point multiplies and
111
- ///< adds/subtracts operations
112
- #define HIPRTC_JIT_POSITION_INDEPENDENT_CODE hipJitOptionPositionIndependentCode ///< CUDA Only Generates
113
- ///< Position Independent code
114
- #define HIPRTC_JIT_MIN_CTA_PER_SM hipJitOptionMinCTAPerSM ///< CUDA Only Hints to JIT compiler
115
- ///< the minimum number of CTAs frin
116
- ///< kernel's grid to be mapped to SM
117
- #define HIPRTC_JIT_MAX_THREADS_PER_BLOCK hipJitOptionMaxThreadsPerBlock ///< CUDA only Maximum number of
118
- ///< threads in a thread block
119
- #define HIPRTC_JIT_OVERRIDE_DIRECT_VALUES hipJitOptionOverrideDirectiveValues ///< CUDA only Override Directive
120
- ///< Values
121
- #define HIPRTC_JIT_NUM_OPTIONS hipJitOptionNumOptions ///< Number of options
122
- #define HIPRTC_JIT_IR_TO_ISA_OPT_EXT hipJitOptionIRtoISAOptExt ///< HIP Only Linker options to be
123
- ///< passed on to compiler
124
- #define HIPRTC_JIT_IR_TO_ISA_OPT_COUNT_EXT hipJitOptionIRtoISAOptCountExt ///< HIP Only Count of linker options
125
- ///< to be passed on to
68
+
69
+ typedef enum hiprtcJIT_option {
70
+ HIPRTC_JIT_MAX_REGISTERS = 0 , ///< CUDA Only Maximum registers may be used in a thread, passed to compiler
71
+ HIPRTC_JIT_THREADS_PER_BLOCK , ///< CUDA Only Number of thread per block
72
+ HIPRTC_JIT_WALL_TIME , ///< CUDA Only Value for total wall clock time
73
+ HIPRTC_JIT_INFO_LOG_BUFFER , ///< CUDA Only Pointer to the buffer with logged information
74
+ HIPRTC_JIT_INFO_LOG_BUFFER_SIZE_BYTES , ///< CUDA Only Size of the buffer in bytes for logged info
75
+ HIPRTC_JIT_ERROR_LOG_BUFFER , ///< CUDA Only Pointer to the buffer with logged error(s)
76
+ HIPRTC_JIT_ERROR_LOG_BUFFER_SIZE_BYTES , ///< CUDA Only Size of the buffer in bytes for logged error(s)
77
+ HIPRTC_JIT_OPTIMIZATION_LEVEL , ///< Value of optimization level for generated codes, acceptable options -O0, -O1, -O2, -O3
78
+ HIPRTC_JIT_TARGET_FROM_HIPCONTEXT , ///< CUDA Only The target context, which is the default
79
+ HIPRTC_JIT_TARGET , ///< CUDA Only JIT target
80
+ HIPRTC_JIT_FALLBACK_STRATEGY , ///< CUDA Only Fallback strategy
81
+ HIPRTC_JIT_GENERATE_DEBUG_INFO , ///< CUDA Only Generate debug information
82
+ HIPRTC_JIT_LOG_VERBOSE , ///< CUDA Only Generate log verbose
83
+ HIPRTC_JIT_GENERATE_LINE_INFO , ///< CUDA Only Generate line number information
84
+ HIPRTC_JIT_CACHE_MODE , ///< CUDA Only Set cache mode
85
+ HIPRTC_JIT_NEW_SM3X_OPT , ///< @deprecated CUDA Only New SM3X option.
86
+ HIPRTC_JIT_FAST_COMPILE , ///< CUDA Only Set fast compile
87
+ HIPRTC_JIT_GLOBAL_SYMBOL_NAMES , ///< CUDA Only Array of device symbol names to be relocated to the host
88
+ HIPRTC_JIT_GLOBAL_SYMBOL_ADDRESS , ///< CUDA Only Array of host addresses to be relocated to the device
89
+ HIPRTC_JIT_GLOBAL_SYMBOL_COUNT , ///< CUDA Only Number of symbol count.
90
+ HIPRTC_JIT_LTO , ///< @deprecated CUDA Only Enable link-time optimization for device code
91
+ HIPRTC_JIT_FTZ , ///< @deprecated CUDA Only Set single-precision denormals.
92
+ HIPRTC_JIT_PREC_DIV , ///< @deprecated CUDA Only Set single-precision floating-point division and
93
+ ///< reciprocals
94
+ HIPRTC_JIT_PREC_SQRT , ///< @deprecated CUDA Only Set single-precision floating-point square root
95
+ HIPRTC_JIT_FMA , ///< @deprecated CUDA Only Enable floating-point multiplies and adds/subtracts operations
96
+ HIPRTC_JIT_NUM_OPTIONS , ///< Number of options
97
+ HIPRTC_JIT_IR_TO_ISA_OPT_EXT = 10000 , ///< Linker options to be passed on to compiler
98
+ /// @note Only supported for the AMD platform.
99
+ HIPRTC_JIT_IR_TO_ISA_OPT_COUNT_EXT , ///< Count of linker options to be passed on to
100
+ ///< compiler @note Only supported for the AMD platform
101
+ } hiprtcJIT_option ;
102
+
126
103
/**
127
104
* hiprtc JIT input type
128
105
*/
129
- #define hiprtcJITInputType hipJitInputType
130
- #define HIPRTC_JIT_INPUT_CUBIN hipJitInputCubin ///< Cuda only Input Cubin
131
- #define HIPRTC_JIT_INPUT_PTX hipJitInputPtx ///< Cuda only Input PTX
132
- #define HIPRTC_JIT_INPUT_FATBINARY hipJitInputFatBinary ///< Cuda Only Input FAT Binary
133
- #define HIPRTC_JIT_INPUT_OBJECT hipJitInputObject ///< Cuda Only Host Object with embedded device code
134
- #define HIPRTC_JIT_INPUT_LIBRARY hipJitInputLibrary ///< Cuda Only Archive of Host Objects with embedded device code
135
- #define HIPRTC_JIT_INPUT_NVVM hipJitInputNvvm ///< @deprecated CUDA only High Level intermediate code for LTO
136
- #define HIPRTC_JIT_NUM_LEGACY_INPUT_TYPES hipJitNumLegacyInputTypes ///< Count of Legacy Input Types
137
- #define HIPRTC_JIT_INPUT_LLVM_BITCODE hipJitInputLLVMBitcode ///< HIP Only LLVM Bitcode or IR assembly
138
- #define HIPRTC_JIT_INPUT_LLVM_BUNDLED_BITCODE hipJitInputLLVMBundledBitcode ///< HIP Only LLVM Clang Bundled Code
139
- #define HIPRTC_JIT_INPUT_LLVM_ARCHIVES_OF_BUNDLED_BITCODE hipJitInputLLVMArchivesOfBundledBitcode ///< HIP Only LLVM
140
- ///< Archives of
141
- ///< Bundled Bitcode
142
- #define HIPRTC_JIT_INPUT_SPIRV hipJitInputSpirv ///< HIP Only SPIRV Code Object
143
- #define HIPRTC_JIT_NUM_INPUT_TYPES hipJitNumInputTypes ///< Count of Input Types
106
+ typedef enum hiprtcJITInputType {
107
+ HIPRTC_JIT_INPUT_CUBIN = 0 , ///< Input cubin
108
+ HIPRTC_JIT_INPUT_PTX , ///< Input PTX
109
+ HIPRTC_JIT_INPUT_FATBINARY , ///< Input fat binary
110
+ HIPRTC_JIT_INPUT_OBJECT , ///< Input object
111
+ HIPRTC_JIT_INPUT_LIBRARY , ///< Input library
112
+ HIPRTC_JIT_INPUT_NVVM , ///< Input NVVM
113
+ HIPRTC_JIT_NUM_LEGACY_INPUT_TYPES , ///< Number of legacy input type
114
+ HIPRTC_JIT_INPUT_LLVM_BITCODE = 100 , ///< LLVM bitcode or IR assembly
115
+ HIPRTC_JIT_INPUT_LLVM_BUNDLED_BITCODE = 101 , ///< LLVM bundled bitcode
116
+ HIPRTC_JIT_INPUT_LLVM_ARCHIVES_OF_BUNDLED_BITCODE = 102 , ///< LLVM archives of boundled bitcode
117
+ HIPRTC_JIT_NUM_INPUT_TYPES = (HIPRTC_JIT_NUM_LEGACY_INPUT_TYPES + 3 )
118
+ } hiprtcJITInputType ;
144
119
/**
145
120
* @}
146
121
*/
0 commit comments