Skip to content
Permalink
Browse files

Remove Vecmathlib from build system.

  • Loading branch information
franz committed Oct 22, 2018
1 parent ec4585b commit b4017fd9eac53330234c743e20578f4930293f0a
@@ -14,14 +14,6 @@ examples/Rodinia/pathfinder.stdout export-ignore

lib/kernel/amdgcn export-ignore
lib/kernel/convert_type.py export-ignore
lib/kernel/vecmathlib/bench.cc export-ignore
lib/kernel/vecmathlib/coeffs.out export-ignore
lib/kernel/vecmathlib/example.cc export-ignore
lib/kernel/vecmathlib/example_float.cc export-ignore
lib/kernel/vecmathlib/find-coeffs.m export-ignore
lib/kernel/vecmathlib/IDEAS export-ignore
lib/kernel/vecmathlib/instantiations.cc export-ignore
lib/kernel/vecmathlib/interp.cc export-ignore

lib/kernel/libclc-pocl/gen_vectorize.rb export-ignore
lib/kernel/sleef/gen* export-ignore
@@ -555,71 +555,13 @@ endif()

######################################################################################

if((DEFINED ENABLE_VECMATHLIB) AND (DEFINED ENABLE_SLEEF))
if(ENABLE_SLEEF AND ENABLE_VECMATHLIB)
message(FATAL_ERROR "requested to use both Vecmathlib and SLEEF - pick one!")
endif()
option(ENABLE_SLEEF "Use SLEEF for kernel library" ON)

if((NOT ENABLE_SLEEF) AND (NOT ENABLE_VECMATHLIB))
message(FATAL_ERROR "requested to use neither Vecmathlib nor SLEEF - pick one!")
endif()
endif()
option(ENABLE_CONFORMANCE "Enable conformance to OpenCL standard. Disabling this may enable slightly faster kernel library functions (at a price of range/precision). Note that enabling this does not guarantee conformance (depends on hardware)" ON)

if(NOT DEFINED ENABLE_CONFORMANCE)
if(((DEFINED ENABLE_VECMATHLIB) AND ENABLE_VECMATHLIB) OR
((DEFINED ENABLE_SLEEF) AND (NOT ENABLE_SLEEF)))
set(DEFAULT_CONF OFF)
set(DEFAULT_SLEEF OFF)
set(DEFAULT_VML ON)
else()
set(DEFAULT_CONF ON)
set(DEFAULT_SLEEF ON)
set(DEFAULT_VML OFF)
endif()
else()
set(DEFAULT_CONF ${ENABLE_CONFORMANCE})
if (ENABLE_CONFORMANCE)
# requested conformant
if((DEFINED ENABLE_VECMATHLIB) AND ENABLE_VECMATHLIB)
message(FATAL_ERROR "requested to use Vecmathlib with enabled conformance")
endif()
if((DEFINED ENABLE_SLEEF) AND (NOT ENABLE_SLEEF))
message(FATAL_ERROR "conformance needs enabled SLEEF")
endif()
set(DEFAULT_SLEEF ON)
set(DEFAULT_VML OFF)
else()
# requested non-conformant
set(DEFAULT_SLEEF ${ENABLE_SLEEF})
set(DEFAULT_VML ${ENABLE_VECMATHLIB})
# at least one
if((NOT DEFAULT_SLEEF) AND (NOT DEFAULT_VML))
set(DEFAULT_VML ON)
set(DEFAULT_SLEEF OFF)
endif()
endif()

endif()

option(ENABLE_CONFORMANCE "Enable conformance to OpenCL standard. Disabling this may enable slightly faster kernel library functions (at a price of range/precision). Note that enabling this does not guarantee conformance (depends on hardware). Incompatible with Vecmathlib. Defaults to ON" ${DEFAULT_CONF})

option(ENABLE_SLEEF "Use SLEEF for kernel library, mutually exclusive with ENABLE_VECMATHLIB" ${DEFAULT_SLEEF})

option(ENABLE_VECMATHLIB "Use vecmathlib for kernel library, mutually exclusive with ENABLE_SLEEF" ${DEFAULT_VML})

if((NOT CLANGXX_WORKS) AND ENABLE_VECMATHLIB)
message(WARNING "Disabling vecmathlib because clang++ doesn't seem to work!")
set(ENABLE_VECMATHLIB OFF)
set(ENABLE_VECMATHLIB OFF CACHE BOOL "VML" FORCE)
set(ENABLE_SLEEF ON)
set(ENABLE_SLEEF ON CACHE BOOL "SLEEF" FORCE)
endif()

# vecmathlib does not compile with fp16 currently
if(ENABLE_VECMATHLIB AND (NOT CL_DISABLE_HALF))
message(STATUS "Half available, but disabling half support since vecmathlib is enabled.")
set(CL_DISABLE_HALF 1)
set(CL_DISABLE_HALF 1 CACHE BOOL "Disable cl_khr_fp16 because fp16 is not supported")
if(ENABLE_CONFORMANCE AND (NOT ENABLE_SLEEF))
message(FATAL_ERROR "conformance needs enabled SLEEF")
endif()

######################################################################################
@@ -682,15 +624,6 @@ set(DEFAULT_KERNEL_CL_FLAGS "-xcl -fno-stack-protector -fPIC ${RTLIB_FLAG}")
set(DEFAULT_KERNEL_C_FLAGS "-xc -std=c11 -D__CBUILD__ -fno-math-errno -fno-stack-protector -fPIC ${RTLIB_FLAG}")
set(DEFAULT_KERNEL_CXX_FLAGS "-xc++ -std=c++11 -fno-stack-protector -fPIC ${RTLIB_FLAG}")

if(ENABLE_VECMATHLIB)
option(USE_VECMATHLIB_BUILTINS_ONLY "Use only __builtin_* functions in the kernel library." OFF)
set(DEFAULT_KERNEL_CXX_FLAGS "${DEFAULT_KERNEL_CXX_FLAGS} -DVML_NO_IOSTREAM ${CLANGXX_STDLIB} ")
if(USE_VECMATHLIB_BUILTINS_ONLY)
set(DEFAULT_KERNEL_CL_FLAGS "${DEFAULT_KERNEL_CL_FLAGS} -DPOCL_VECMATHLIB_BUILTIN ")
set(DEFAULT_KERNEL_CXX_FLAGS "${DEFAULT_KERNEL_CXX_FLAGS} -DPOCL_VECMATHLIB_BUILTIN ")
endif()
endif()

set(EXTRA_KERNEL_FLAGS "" CACHE STRING "Extra arguments to all kernel compilation commands (defaults to empty)")
set(EXTRA_KERNEL_CL_FLAGS "" CACHE STRING "Extra arguments to kernel CL compiler (defaults to empty)")
set(EXTRA_KERNEL_CXX_FLAGS "" CACHE STRING "Extra arguments to kernel CXX compiler (defaults to empty)")
@@ -1579,7 +1512,6 @@ MESSAGE(STATUS "ENABLE_LSAN (leak sanitizer): ${ENABLE_LSAN}")
MESSAGE(STATUS "ENABLE_TSAN (thread sanitizer): ${ENABLE_TSAN}")
MESSAGE(STATUS "ENABLE_UBSAN (UB sanitizer): ${ENABLE_UBSAN}")
MESSAGE(STATUS "ENABLE_POCL_FLOAT_CONVERSION: ${ENABLE_POCL_FLOAT_CONVERSION}")
MESSAGE(STATUS "ENABLE_VECMATHLIB: ${ENABLE_VECMATHLIB}")
MESSAGE(STATUS "ENABLE_SLEEF: ${ENABLE_SLEEF}")
MESSAGE(STATUS "ENABLE_SPIR: ${ENABLE_SPIR}")
MESSAGE(STATUS "ENABLE_SPIRV: ${ENABLE_SPIRV}")
@@ -538,7 +538,7 @@ endmacro()
#

# TODO clang + vecmathlib doesn't work on Windows yet...
if(CLANGXX AND ENABLE_VECMATHLIB AND (NOT WIN32) AND ENABLE_HOST_CPU_DEVICES)
if(CLANGXX AND (NOT WIN32) AND ENABLE_HOST_CPU_DEVICES)

message(STATUS "Checking if clang++ works (required by vecmathlib)")

@@ -39,7 +39,6 @@ function(compile_c_to_bc FILENAME SUBDIR BC_FILE_LIST)
DEPENDS "${FULL_F_PATH}"
"${CMAKE_SOURCE_DIR}/include/pocl_types.h"
"${CMAKE_SOURCE_DIR}/include/_kernel_c.h"
${VML_KERNEL_DEPEND_HEADERS}
COMMAND "${CLANG}" ${CLANG_FLAGS} ${DEVICE_CL_FLAGS} "-O1"
${KERNEL_C_FLAGS} "-o" "${BC_FILE}" "-c" "${FULL_F_PATH}"
"-I${CMAKE_SOURCE_DIR}/include"
@@ -56,7 +55,6 @@ function(compile_cc_to_bc FILENAME SUBDIR BC_FILE_LIST)

add_custom_command(OUTPUT "${BC_FILE}"
DEPENDS "${FULL_F_PATH}"
${VML_KERNEL_DEPEND_HEADERS}
COMMAND "${CLANGXX}" ${CLANG_FLAGS} ${KERNEL_CXX_FLAGS}
${DEVICE_CL_FLAGS} "-o" "${BC_FILE}" "-c" "${FULL_F_PATH}" "-O1"
COMMENT "Building C++ to LLVM bitcode ${BC_FILE}"
@@ -89,10 +87,6 @@ function(compile_cl_to_bc FILENAME SUBDIR BC_FILE_LIST EXTRA_CONFIG)
"-include" "${EXTRA_CONFIG}")
endif()

if(FILENAME MATCHES "vecmathlib")
list(APPEND DEPENDLIST ${VML_KERNEL_DEPEND_HEADERS})
endif()

if(FILENAME MATCHES "libclc")
list(APPEND DEPENDLIST ${LIBCLC_KERNEL_DEPEND_HEADERS})

@@ -33,8 +33,6 @@

#cmakedefine ENABLE_SLEEF

#cmakedefine ENABLE_VECMATHLIB

#cmakedefine ENABLE_SPIR

#cmakedefine ENABLE_SPIRV
@@ -9,10 +9,10 @@ Conformance related CMake options

- ``-DENABLE_CONFORMANCE=ON/OFF``
This is mostly related to the kernel library (the runtime is always built to
be conformant on x86). Defaults to ON. This option merely ensures that build
options which would result in non-conformant kernel library (-DENABLE_VECMATHLIB)
stay disabled, and the option that enables conformant kernel library (currently
-DENABLE_SLEEF, this may change in future) is enabled.
be conformant on x86). Defaults to ON. This option by itself does not
guarantee OpenCL-conformant build; it merely ensures that a build fails
if some options which would result in non-conformant kernel library
(-DENABLE_SLEEF=OFF) are given.

Non-conformant kernel library might be somewhat faster, at the expense of
precision and/or range. Note that conformance was tested **only** on certain
@@ -69,10 +69,6 @@ POname(clGetPlatformInfo)(cl_platform_id platform,
", SPIR-V"
#endif

#ifdef ENABLE_VECMATHLIB
", VML"
#endif

#ifdef ENABLE_SLEEF
", SLEEF"
#endif

0 comments on commit b4017fd

Please sign in to comment.
You can’t perform that action at this time.