31 lines
580 B
Makefile
31 lines
580 B
Makefile
##
|
|
# 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
|