Skip to content

Commit 271a1f0

Browse files
committed
Fix CUDA build after LLVM commit c37145c
1 parent c410139 commit 271a1f0

File tree

2 files changed

+0
-144
lines changed

2 files changed

+0
-144
lines changed

libclc/CMakeLists.txt

Lines changed: 0 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ if( "spirv-mesa3d-" IN_LIST LIBCLC_TARGETS_TO_BUILD OR "spirv64-mesa3d-" IN_LIST
137137
endif()
138138
endif()
139139

140-
set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake )
141140
set( CMAKE_CLC_COMPILER ${LLVM_CLANG} )
142141
set( CMAKE_CLC_ARCHIVE ${LLVM_LINK} )
143142
set( CMAKE_LLAsm_PREPROCESSOR ${LLVM_CLANG} )
@@ -258,51 +257,6 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
258257
LIB_DIR libspirv
259258
DIRS ${dirs} ${DARCH} ${DARCH}-${OS} ${DARCH}-${VENDOR}-${OS}
260259
DEPS convert-spirv.cl convert-core.cl)
261-
# Enumerate SOURCES* files
262-
set( source_list )
263-
foreach( l ${dirs} ${DARCH} ${DARCH}-${OS} ${DARCH}-${VENDOR}-${OS} )
264-
foreach( s "SOURCES" "SOURCES_${LLVM_MAJOR}.${LLVM_MINOR}" )
265-
file( TO_CMAKE_PATH ${l}/lib/${s} file_loc )
266-
file( TO_CMAKE_PATH ${CMAKE_SOURCE_DIR}/${file_loc} loc )
267-
# Prepend the location to give higher priority to
268-
# specialized implementation
269-
if( EXISTS ${loc} )
270-
set( source_list ${file_loc} ${source_list} )
271-
endif()
272-
endforeach()
273-
endforeach()
274-
275-
# Add the generated convert.cl here to prevent adding
276-
# the one listed in SOURCES
277-
if( NOT ${ARCH} STREQUAL "spirv" AND NOT ${ARCH} STREQUAL "spirv64" )
278-
set( rel_files convert.cl )
279-
set( objects convert.cl )
280-
if( NOT ENABLE_RUNTIME_SUBNORMAL )
281-
list( APPEND rel_files generic/lib/subnormal_use_default.ll )
282-
endif()
283-
else()
284-
set( rel_files )
285-
set( objects )
286-
endif()
287-
288-
foreach( l ${source_list} )
289-
file( READ ${l} file_list )
290-
string( REPLACE "\n" ";" file_list ${file_list} )
291-
get_filename_component( dir ${l} DIRECTORY )
292-
foreach( f ${file_list} )
293-
list( FIND objects ${f} found )
294-
if( found EQUAL -1 )
295-
list( APPEND objects ${f} )
296-
list( APPEND rel_files ${dir}/${f} )
297-
# FIXME: This should really go away
298-
file( TO_CMAKE_PATH ${CMAKE_SOURCE_DIR}/${dir}/${f} src_loc )
299-
get_filename_component( fdir ${src_loc} DIRECTORY )
300-
301-
set_source_files_properties( ${dir}/${f}
302-
PROPERTIES COMPILE_FLAGS "-I ${fdir}" )
303-
endif()
304-
endforeach()
305-
endforeach()
306260

307261
foreach( d ${${t}_devices} )
308262
# Some targets don't have a specific GPU to target
@@ -344,95 +298,6 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
344298
ALIASES ${${d}_aliases}
345299
GENERATE_TARGET "generate_convert_clc.cl"
346300
PARENT_TARGET libclc-builtins)
347-
message( " DEVICE: ${d} ( ${${d}_aliases} )" )
348-
349-
if ( ${ARCH} STREQUAL "spirv" OR ${ARCH} STREQUAL "spirv64" )
350-
if( ${ARCH} STREQUAL "spirv" )
351-
set( t "spir--" )
352-
else()
353-
set( t "spir64--" )
354-
endif()
355-
set( build_flags -O0 -finline-hint-functions )
356-
set( opt_flags )
357-
set( spvflags --spirv-max-version=1.1 )
358-
else()
359-
set( build_flags )
360-
set( opt_flags -O3 )
361-
endif()
362-
363-
add_library( builtins.link.${arch_suffix} STATIC ${rel_files} )
364-
# Make sure we depend on the pseudo target to prevent
365-
# multiple invocations
366-
add_dependencies( builtins.link.${arch_suffix}
367-
generate_convert.cl )
368-
# CMake will turn this include into absolute path
369-
target_include_directories( builtins.link.${arch_suffix} PRIVATE
370-
"generic/include" )
371-
target_compile_definitions( builtins.link.${arch_suffix} PRIVATE
372-
"__CLC_INTERNAL" )
373-
string( TOUPPER "-DCLC_${ARCH}" CLC_TARGET_DEFINE )
374-
target_compile_definitions( builtins.link.${arch_suffix} PRIVATE
375-
${CLC_TARGET_DEFINE} )
376-
target_compile_options( builtins.link.${arch_suffix} PRIVATE -target
377-
${t} ${mcpu} -fno-builtin -nostdlib ${build_flags} )
378-
set_target_properties( builtins.link.${arch_suffix} PROPERTIES
379-
LINKER_LANGUAGE CLC )
380-
381-
set( obj_suffix ${arch_suffix}.bc )
382-
383-
# Add opt target
384-
add_custom_command( OUTPUT "builtins.opt.${obj_suffix}"
385-
COMMAND ${LLVM_OPT} ${opt_flags} -o
386-
"builtins.opt.${obj_suffix}"
387-
"builtins.link.${obj_suffix}"
388-
DEPENDS "builtins.link.${arch_suffix}" )
389-
add_custom_target( "opt.${obj_suffix}" ALL
390-
DEPENDS "builtins.opt.${obj_suffix}" )
391-
392-
if( ${ARCH} STREQUAL "spirv" OR ${ARCH} STREQUAL "spirv64" )
393-
set( spv_suffix ${arch_suffix}.spv )
394-
add_custom_command( OUTPUT "${spv_suffix}"
395-
COMMAND ${LLVM_SPIRV} ${spvflags}
396-
-o "${spv_suffix}"
397-
"builtins.link.${obj_suffix}"
398-
DEPENDS "builtins.link.${arch_suffix}" )
399-
add_custom_target( "prepare-${spv_suffix}" ALL
400-
DEPENDS "${spv_suffix}" )
401-
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${spv_suffix}
402-
DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
403-
else()
404-
405-
# Add prepare target
406-
add_custom_command( OUTPUT "${obj_suffix}"
407-
COMMAND prepare_builtins -o
408-
"${obj_suffix}"
409-
"builtins.opt.${obj_suffix}"
410-
DEPENDS "opt.${obj_suffix}"
411-
"builtins.opt.${obj_suffix}"
412-
prepare_builtins )
413-
add_custom_target( "prepare-${obj_suffix}" ALL
414-
DEPENDS "${obj_suffix}" )
415-
416-
# nvptx-- targets don't include workitem builtins
417-
if( NOT ${t} MATCHES ".*ptx.*--$" )
418-
add_test( NAME external-calls-${obj_suffix}
419-
COMMAND ./check_external_calls.sh ${CMAKE_CURRENT_BINARY_DIR}/${obj_suffix}
420-
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} )
421-
set_tests_properties( external-calls-${obj_suffix}
422-
PROPERTIES ENVIRONMENT "LLVM_CONFIG=${LLVM_CONFIG}" )
423-
endif()
424-
425-
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${obj_suffix} DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
426-
foreach( a ${${d}_aliases} )
427-
set( alias_suffix "${a}-${t}.bc" )
428-
add_custom_target( ${alias_suffix} ALL
429-
COMMAND ${CMAKE_COMMAND} -E
430-
create_symlink ${obj_suffix}
431-
${alias_suffix}
432-
DEPENDS "prepare-${obj_suffix}" )
433-
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${alias_suffix} DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
434-
endforeach( a )
435-
endif()
436301
endforeach( d )
437302
endforeach( t )
438303

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
#include <spirv/spirv.h>
22

3-
<<<<<<< HEAD:libclc/r600/libspirv/workitem/get_work_dim.cl
4-
_CLC_DEF _CLC_OVERLOAD uint __spirv_WorkDim(void)
5-
{
6-
__attribute__((address_space(7))) uint * ptr =
7-
(__attribute__((address_space(7))) uint *)
8-
__builtin_r600_implicitarg_ptr();
9-
return ptr[0];
10-
=======
113
_CLC_DEF _CLC_OVERLOAD uint get_work_dim(void) {
124
__attribute__((address_space(7))) uint *ptr =
135
(__attribute__((address_space(7)))
146
uint *)__builtin_r600_implicitarg_ptr();
157
return ptr[0];
16-
>>>>>>> 3d21fa56f5f5afbbf16b35b199480af71e1189a3:libclc/r600/lib/workitem/get_work_dim.cl
178
}

0 commit comments

Comments
 (0)