Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMCP for OpenCL? #1443

Open
yangfengzzz opened this issue Apr 21, 2024 · 3 comments
Open

SMCP for OpenCL? #1443

yangfengzzz opened this issue Apr 21, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@yangfengzzz
Copy link

I found there olny SSCP for OpenCL, Is it possible to implement OpenCL SMCP compilation flow in the future? I found it difficult to embed OpenCL into Cpp like CUDA

@yangfengzzz yangfengzzz added the enhancement New feature or request label Apr 21, 2024
@illuhad
Copy link
Collaborator

illuhad commented Apr 21, 2024

It is not planned to implement SMCP for OpenCL, and there is also no reason or use case to do so. The SSCP compiler is superior in every way to the SMCP approach: It compiles faster, generates faster binaries, allows for additional JIT-time optimizations that are not possible with the SMCP compilers, is more portable and extensible, and is a more elegant design.

Why do you want an SMCP compiler?

The only thing that the SMCP compilers give you is that they allow to mix-and-match CUDA/HIP source code with SYCL. This can be useful when migrating code. For OpenCL, this is irrelevant because OpenCL has a separate source compilation models, so wouldn't get the same benefits from an SMCP compiler either.

@yangfengzzz
Copy link
Author

Because on my device there is only OpenCL. So I hope there is a SMCP compiler to compile directly. I think SSCP is too troublesome by saving LLVM IR. With SSCP, additional transcoding work has to be done at runtime.

@illuhad
Copy link
Collaborator

illuhad commented Apr 22, 2024

It has a persistent on-disk kernel cache that negates pretty much all of those effects after the first application run. And even in plain OpenCL with ahead of time code generation, the driver would still need to lower SPIR-V at runtime to OpenCL, because this is how OpenCL works.

Please try SSCP first before asking for someone else. Again, it is superior to SMCP compilers in every way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants