File tree Expand file tree Collapse file tree 5 files changed +29
-0
lines changed Expand file tree Collapse file tree 5 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ include /CL /sycl /version.hpp
Original file line number Diff line number Diff line change @@ -34,6 +34,12 @@ find_package(OpenCL REQUIRED)
34
34
include_directories (${OpenCL_INCLUDE_DIRS} )
35
35
link_libraries (OpenCL )
36
36
37
+ # Configure SYCL version macro
38
+ set (sycl_inc_dir ${CMAKE_CURRENT_SOURCE_DIR} /include/CL )
39
+ string (TIMESTAMP __SYCL_COMPILER_VERSION "%Y%m%d" )
40
+ set (version_header "${sycl_inc_dir} /sycl/version.hpp" )
41
+ configure_file ("${version_header} .in" "${version_header} " )
42
+
37
43
# Copy SYCL headers
38
44
set (sycl_inc_dir ${CMAKE_CURRENT_SOURCE_DIR} /include/CL )
39
45
set (dst_dir ${LLVM_LIBRARY_OUTPUT_INTDIR} /clang/${CLANG_VERSION}/include/CL )
Original file line number Diff line number Diff line change 35
35
#include < CL/sycl/queue.hpp>
36
36
#include < CL/sycl/range.hpp>
37
37
#include < CL/sycl/types.hpp>
38
+ #include < CL/sycl/version.hpp>
38
39
39
40
// Do not include RT only function implementations for device code as it leads
40
41
// to problem. Should be finally fixed when we introduce library.
Original file line number Diff line number Diff line change
1
+ // ==------ version.hpp --- SYCL compiler version macro ---------*- C++ -*---==//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ // ===----------------------------------------------------------------------===//
8
+
9
+ #cmakedefine __SYCL_COMPILER_VERSION ${__SYCL_COMPILER_VERSION}
Original file line number Diff line number Diff line change
1
+ // RUN: %clang -std=c++11 -g %s -o %t.out -lstdc++ -lOpenCL -lsycl
2
+
3
+ #include < CL/sycl.hpp>
4
+ #include < iostream>
5
+
6
+ int main () {
7
+ std::cout << " SYCL language version: " << CL_SYCL_LANGUAGE_VERSION
8
+ << std::endl;
9
+ std::cout << " SYCL compiler version: " << __SYCL_COMPILER_VERSION
10
+ << std::endl;
11
+ return 0 ;
12
+ }
You can’t perform that action at this time.
0 commit comments