Comments (7)
Although we can just rename the variable in libcxx, I wonder if we really need these __global
, __local
and __private
aliases in SYCL. They should not be exposed to the users anyway, and for the SYCL library code we can use __attribute__((address_space(1)))
syntax.
from llvm.
I think ComputeCpp does or used to do something similar to what you suggest (perhaps for other reasons): https://developer.codeplay.com/products/computecpp/ce/api-reference/base_8h
Maybe @Ruyk or @Naghasan will be able to elaborate on it or correct me though if my assumption is wrong
from llvm.
Another option is to use more OpenCL specific keywords (e.g. __opencl_global
) instead of quite generic __global
.
NOTE: address space are mapping is target dependent.
from llvm.
Although we can just rename the variable in libcxx, I wonder if we really need these
__global
,__local
and__private
aliases in SYCL. They should not be exposed to the users anyway
They need to be exposed somehow, as SYCL 1.2.1 defines interop type like global_ptr<T>::pointer
, but it is up to the implementation to define the "how" as the definition is implementation defined.
I think the main problem here is that __global
and co are keywords, which I believe is the root of the problem.
and for the SYCL library code we can use
__attribute__((address_space(1)))
syntax.
As @bader said, this sets a target address space, so its is actually different from the language address space.
I think ComputeCpp does or used to do something similar to what you suggest (perhaps for other reasons)
We expose the language address spaces as an attribute, which limits the exposure.
Another option is to use more OpenCL specific keywords (e.g.
__opencl_global
) instead of quite generic__global
.
__global
is defined by the OpenCL specs so you can't change it (e.g. https://www.khronos.org/registry/OpenCL/specs/opencl-1.2.pdf section 6.5.1). Although, does it need to a be a keyword ? Or can it be made context sensitive ?
Maybe @AnastasiaStulova has an opinion on this
from llvm.
__global
is defined by the OpenCL specs so you can't change it (e.g. https://www.khronos.org/registry/OpenCL/specs/opencl-1.2.pdf section 6.5.1). Although, does it need to a be a keyword ? Or can it be made context sensitive ?
We are not required to expose OpenCL address spaces using keywords defined the OpenCL spec. The option I mentioned tries to expose OpenCL concept using different keyword, although it might not solve the fundamental problem.
from llvm.
I think this is related to my earlier question about your overall approach to address spaces (#59 (comment))
There are obviously a multiple options available and whichever you select will affect the rest of your compilation flow I believe.
In C++ for OpenCL upstream we are using language address spaces just like we used in OpenCL C. They are enabled by both "__" prefixed spelling and without. However, it is still work in progress and it heavily relies on generic address space feature that I believe is not available in SYCL 1.2...
If you are using __attribute__((address_space(...)))
in C++ code it has a lot less support at the moment and it's also being changed currently https://reviews.llvm.org/D62574. But it is fundamentally different because it is attached to a target and not to the language itself. It is therefore not intended to be portable between targets. I feel it might not be the best fit for SYCL. You might want to review RFC thread on this topic mentioned in the review.
from llvm.
In triSYCL we use __attribute__((address_space(...)))
for now.
from llvm.
Related Issues (20)
- Proposal for improved UR sync process HOT 5
- [SYCL][SPV_INTEL_bindless_images] Add OpConvertHandleToSampledImageINTEL back to the extension
- Cannot build standalone clang due to missing DeviceConfigFile
- [SYCL] 2 tests failed with OpenCL CPU RT 2024.17.3.0.09
- [CUDA][E2E] Graph/Update/RecordReplay/whole_update_double_buffer.cpp failed on SYCL Nightly
- SchedulerTest.HostTaskCleanup failed on Windows with "access violation" HOT 3
- How the kernel's address space mapping space number is mapped to the device? HOT 4
- test_math_builtin_api fails in Nightly HOT 1
- Unexpected pass debug_symbols.cpp after e9befa2d10f6c23a66ac780df7a1ddda55279230
- SYCL :: Graph/Explicit/assume_buffer_outlives_graph_property.cpp failed in post-commit HOT 3
- [E2E][ARC] Plugin/enqueue-arg-order-image.cpp timed out on Arc
- sycl-cts/accessor & sycl-cts/hierarchical fail in Nightly
- [SYCL][CUDA][E2E][Bindless] Bindless Images E2E Tests Failing HOT 1
- [E2E] Basic/event_profiling_info.cpp seems flaky HOT 1
- [SYCL][unittests] Several unittests postcommit failures after 9992f2a HOT 1
- [Matrix][E2E] Matrix/XMX8/joint_matrix_bf16_fill_k_cache_unroll.cpp and joint_matrix_int8_vnni.cpp XPASS'd on ARC post-commit HOT 1
- SYCL Pre Commit on Linux / test (AMD/HIP, ["Linux", "amdgpu"] - fails HOT 1
- [E2E] Basic/kernel_info.cpp XPASS'd on OpenCL FPGA after 2dae6cb HOT 2
- [LIT] extensions/private_alloca.cpp failed on post commit HOT 3
- syclcompat/memory/memory_async.cpp failed in post-commit HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from llvm.