Commit 903d9e89 authored by Pawel Jurek's avatar Pawel Jurek Committed by gbsbuild

Preparations to switch to Clang based on LLVM7

Change-Id: I5514e6853a7273cf42b04530bfaa38ce0bfa62f8
parent 4af438f8
......@@ -43,11 +43,7 @@ void CIF_GET_INTERFACE_CLASS(FclOclDeviceCtx, 1)::SetOclApiVersion(uint32_t oclV
}
CodeType::CodeType_t CIF_GET_INTERFACE_CLASS(FclOclDeviceCtx, 2)::GetPreferredIntermediateRepresentation() {
#if defined __linux__
return CodeType::llvmBc;
#else
return CodeType::spirV;
#endif
return CodeType::llvmBc;
}
FclOclTranslationCtxBase *CIF_GET_INTERFACE_CLASS(FclOclDeviceCtx, 1)::CreateTranslationCtxImpl(CIF::Version_t ver,
......
......@@ -31,6 +31,12 @@
# =============================================== Tools ================================================
# In new Clang versions VME types are built-in. Keep this flag until all OS's update Clang version
set(VME_TYPES_DEFINED FALSE)
if(CMAKE_SYSTEM_NAME STREQUAL Linux)
set(VME_TYPES_DEFINED TRUE)
endif()
# Decompress Clang
# Add bogus targets to identify the .7z file and the decompressed .exe file
add_library(CLANG_7Z UNKNOWN IMPORTED)
......@@ -156,6 +162,7 @@
else()
# Do not use precompiled common clang.
message(STATUS "Precompiled common clang bundle ${_clang7zLocation} does not exist. Try to compile from sources.")
set(VME_TYPES_DEFINED FALSE)
# if not specified from outside
# try to use common clang component from one of fixed locations
if(NOT IGC_CCLANG_HOME_DIR)
......@@ -895,6 +902,10 @@ file(GLOB_RECURSE _MATH_SRC_BC "${IGC_OPTION__BIF_SRC_OCL_DIR}/*.bc")
file(GLOB_RECURSE SVML_FILES "${IGC_OPTION__BIF_SRC_OCL_DIR}/Implementation/BinaryReleaseOnly/*.cl" )
set(FLAG "")
if(${VME_TYPES_DEFINED})
list(APPEND FLAG "__VME_TYPES_DEFINED__")
endif(VME_TYPES_DEFINED)
igc_bif_find_cl_files(IGC_BUILD__BIF_OCL_COMMON_DEPENDS ${IGC_BUILD__BIF_OCL_COMMON_INC_DIRS} "${IGC_OPTION__BIF_SRC_OCL_DIR}/Implementation")
......
......@@ -401,12 +401,12 @@ ndrange_t __attribute__((overloadable)) ndrange_3D(const size_t[3]);
ndrange_t __attribute__((overloadable)) ndrange_3D(const size_t[3], const size_t[3]);
ndrange_t __attribute__((overloadable)) ndrange_3D(const size_t[3], const size_t[3], const size_t[3]);
#ifndef __CLANG_50__
#ifndef __VME_TYPES_DEFINED__ // Clang 7.0+
#if defined(cl_khr_subgroups)
uint __attribute__((overloadable)) get_kernel_sub_group_count_for_ndrange(const ndrange_t range, void(^block)(void));
uint __attribute__((overloadable)) get_kernel_max_sub_group_size_for_ndrange(const ndrange_t range, void(^block)(void));
#endif
#endif // !__CLANG_50__
#endif // !__VME_TYPES_DEFINED__
void __attribute__((overloadable)) retain_event(clk_event_t);
......
......@@ -815,10 +815,7 @@ namespace TC
\*****************************************************************************/
bool AreVMETypesDefined()
{
#if defined __linux__
return false;
#endif
return true;
}
/*****************************************************************************\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment