make it compile with cmake.

This commit is contained in:
2025-09-23 19:08:56 +02:00
parent 59411ea4ce
commit 377582c833
25 changed files with 56742 additions and 78 deletions

30
kernels/Makefile Normal file
View File

@ -0,0 +1,30 @@
##
# compile kernels
#
# @file
# @version 0.1
GLSL := $(shell find -name '*.cl')
SPHV := $(GLSL:.cl=.clbin)
#set flags for kernel compiling
GPU_VENDOR := glxinfo | grep -E "OpenGL vendor | OpenGL renderer" | cut -d" " -f4
ARCH := uname -m
ifeq ($(GPU_VENDOR),"AMD")
CLFLAGS := --target=amdgcn-amd-amdhsa -mcpu=gfx900
else ifeq ($(GPU_VENDOR),"NVIDIA")
CLFLAGS := --target=nvtpx64-unkown-unkown
else ifeq ($(ARCH), "x86_64")
CLFLAGS := --target=spirv64
else
CLFLAGS := --target=spirv32
endif
CXX := clang
$(SPHV): $(GLSL)
$(CXX) -cl-std=CL2.0 $(CLFLAGS) $< -o $@
# end