I need compile OpenCL kernels in SPIR-V to use with Vulkan, I tried with Google CLSPV https://github.com/google/clspv, but the problem occur with vectorization, functions like vload8 doesn't work. So I need compile OpenCL kernels in SPIR-V using clang.
How to compile OpenCL Kernels to SPIR-V using Clang
2.6k views Asked by Alex At
3
There are 3 answers
0
changqi.xia
On
https://github.com/KhronosGroup/SPIR/tree/spirv-1.1
You can follow this Khronos project.
clang -cc1 -emit-spirv -triple=spir-unknown-unknown -cl-std=c++ -I include kernel.cl -o kernel.spv #For OpenCL C++
clang -cc1 -emit-spirv -triple=spir-unknown-unknown -cl-std=CL2.0 -include opencl.h kernel.cl -o kernel.spv #For OpenCL C
Related Questions in CLANG
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Get search paths for headers in the standard library in Clang?
- Build LLVM, Clang and Libfuzzer
- build boost use libc++ on linux use wrong --target
- Clang possibly skipping line(s) of code while compiling
- ld: library 'nsl' not found, /usr/local/go/pkg/tool/darwin_arm64/link: running clang failed: exit status 1 in macOS
- duplicate symbol in clang for template specialization of static member
- Windows shared segment in clang
- How can I switch from clang11 to clang14 on freebsd?
- LLD: How to Use –dll and –add-stdcall-alias Swiches
- dyld error When Including Debug Symbols In native C Library
- How to build veins inet project in omnet
- R2 max value is outside of the allowed memory range after explicit bounds checking
- C++: initialization of auto&& with the ternary operator leads to the copy constructor call on MSVC
- How to identify call void @llvm.dbg.declare instructions in LLVM IR?
Related Questions in OPENCL
- What is the parameter for CLI YOLOv8 predict to use Intel GPU?
- How to exploit Unified Memory in OpenCL with CL_MEM_ALLOC_HOST_PTR flag?
- PyOpenCl code hanging on a simple get() - how can I troubleshoot?
- OpenCL dynamic parallelism enqueue_kernel() functionality
- Do all OpenCL drivers come with the IntelOneAPI compiler
- How to move an array of structures to the GPU?
- Passing arguments to OpenCL kernel, before execution finished
- OpenCV acceleration (OpenCL) of gaussian blur
- CL_DEVICE_NOT_AVAILABLE using Intel(R)Xeon(R)Gold 6240 CPU
- Launch Single Kernel on problem space vs Launch same kernel, multiple times on smaller problem spaces
- Running OpenCL programs on baremetal RISC-V core
- Why did an OpenCL rendering optimization make my code slower?
- OpenCL Kernel hangs at clEnqueueReadBuffer on AMD rocm
- Is it possible to assign works to each GPU thread instead of a work to group of GPU threads?
- Fast way to rearrange bit into new byte
Related Questions in LLVM-CLANG
- no binary file given when building and unknown error below
- Doxygen Build failing for 1.8.20 on ubuntu with Clang
- Overidden delete is not called when compiled with clang 10 for visual studio 2019
- Transforming the Clang AST into an AST in other languages
- clang::ast_matchers::thisPointerType ambiguous call to overloaded function
- Is it possible to build GMP with Clang 10 and LLVM?
- How to make LLVM's `opt` command optimize builtin functions?
- Facing issues while installing pycld2 in mac os 10.15.6. It says failed building wheel for pycld2
- Display an extra text message in LLVM .ll IR
- Why libc dependency despite of -nostdlib
- Converting i1 type to integer value
- llvm-toolset-7-clang rpm installation for RHEL 7
- how to add include paths to clang globally
- Different compile times on Xcode - clang
- Is it safe to consume a C library built with older version of Xcode?
Related Questions in VULKAN
- How to generate vulkan project so it is cross-platform? (Using CMake)
- Vulkan specialization constants in WGSL
- Sync buffer between queue on Vulkan
- Using Silk.NET in WinForms
- Vulkan ‘VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR’ was not declared in this scope
- Members of struct lose value when created by factory method
- VK_ERROR_DEVICE_LOST on create acceleration structure and possible ways to debug it
- Disabling implicit Vulkan Validation Layer via environment variable
- How to VkCmdCopyBuffer without a Single Time Command Buffer
- Compiling vertex shader from vulkan tutorial with glslc gives error: linking multiple files in not supported yet
- Create info crushes the instancing
- panic: runtime error: cgo argument has Go pointer to unpinned Go pointer (in Go Vulkan While Creating a Swapchain)
- ExtensionNotFound Error while all extensions are supported in go-vulkan
- Vulkan: What exactly is the limit of 4 bound descriptor sets associated with in the hardware?
- Vulkan Validation Error from FFMPEG creating an image: VUID-VkImageCreateInfo-pNext-06811
Related Questions in SPIR-V
- How to get more than 80 textures bound to a pipeline with Vulkan for MacOS?
- Generating LLVM IR for spir64 Target with Clang: Clarification on SPIR-V Support
- SPIRV-cross get vertex layout info for Vulkan
- SPIRV-Reflect evaluates BDA size as 16 bytes instead of 8
- My GPUs don't seem to support VK_GOOGLE_HLSL_FUNCTIONALITY1?
- Rust glium with spir-v not working at all
- Passing functions to shaders?
- Why does spirv-remap give different outputs depending on out variable name?
- Why is my HLSL shader unable to compile to SPIRV?
- Failing to specialize OpenGl shader that uses spirv
- Invalid entry point for shader when using HLSL->SPIR-V->OpenGL
- CL_INVALID_KERNEL_NAME with SPIRV programs created with clang on Intel
- HLSL compiled with shaderc and introspected with SPIRV-cross has wrong size?
- Where do shader "static" variables reside in memory?
- Spir-V and OpenGL: Entry points and pipeline stages
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
I'm the project lead for Clspv. Jesse is right overall.
The lack of support for vectors of length 8 and 16 is deliberately out of scope for now.
That's because Vulkan itself does not support that.
We haven't added the support to mimic such support, and don't have plans to do so even in the medium term.
There is more info on an old closed issue:
https://github.com/google/clspv/issues/8