File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ function(embed_binary_to_src file output_file symbol)
125
125
# Convert hex data for C compatibility
126
126
string (REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\ 1," filedata ${filedata} )
127
127
# Write data to output file
128
- file (WRITE ${output_file} "const char ${symbol} [] = {${filedata} };\n const int ${symbol} _size = sizeof(${symbol} );\n " )
128
+ file (WRITE ${output_file} "const unsigned char ${symbol} [] = {${filedata} };\n const int ${symbol} _size = sizeof(${symbol} );\n " )
129
129
endfunction ()
130
130
131
131
set (MLIR_NVVM_EMBED_LIBDEVICE 0 CACHE BOOL "Embed CUDA libdevice.bc in the binary at build time instead of looking it up at runtime" )
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ using namespace mlir::NVVM;
47
47
#define __DEFAULT_CUDATOOLKIT_PATH__ " "
48
48
#endif
49
49
50
- extern " C" const char _mlir_embedded_libdevice[];
50
+ extern " C" const unsigned char _mlir_embedded_libdevice[];
51
51
extern " C" const unsigned _mlir_embedded_libdevice_size;
52
52
53
53
namespace {
@@ -160,7 +160,8 @@ LogicalResult SerializeGPUModuleBase::appendStandardLibs() {
160
160
// Allocate a resource using one of the UnManagedResourceBlob method to wrap
161
161
// the embedded data.
162
162
auto unmanagedBlob = UnmanagedAsmResourceBlob::allocateInferAlign (
163
- ArrayRef<char >{_mlir_embedded_libdevice, _mlir_embedded_libdevice_size});
163
+ ArrayRef<char >{(const char *)_mlir_embedded_libdevice,
164
+ _mlir_embedded_libdevice_size});
164
165
librariesToLink.push_back (DenseResourceElementsAttr::get (
165
166
type, resourceManager.insert (" _mlir_embedded_libdevice" ,
166
167
std::move (unmanagedBlob))));
You can’t perform that action at this time.
0 commit comments