Skip to content

Move SYCL device-side macro initialization from Driver into FE #3972

Closed
@AGindinson

Description

@AGindinson

Generally, SYCL device-side macros are being initialized within clang/Frontend/InitPreprocessor.cpp, e.g. SYCL_EXTERNAL (https://github.com/intel/llvm/blob/sycl/clang/lib/Frontend/InitPreprocessor.cpp#L1180), __SYCL_DEVICE_ONLY__ (https://github.com/intel/llvm/blob/sycl/clang/lib/Frontend/InitPreprocessor.cpp#L1179), target-specific __SYCL_NVPTX__ (https://github.com/intel/llvm/blob/sycl/clang/lib/Frontend/InitPreprocessor.cpp#L1183). However, there are known inconsistencies with this approach:

  1. FPGA-specific __SYCL_ENABLE_USM_ADDR_SPACES__ gets initialized within the Driver: https://github.com/intel/llvm/blob/sycl/clang/lib/Driver/ToolChains/Clang.cpp#L4683
  2. __SYCL_NVPTX__ correctly gets initialized within InitPreprocessor.cpp, but is not LIT-tested within the corresponding sycl-macro.cpp.

Items TBD:

  • Identify and move all device target-specific macro initializations into FE
  • LIT-test these initializations alongside "general" SYCL device macros

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions