From: Romain Perier Date: Tue, 23 Aug 2016 12:19:50 +0000 (+0200) Subject: package/amd-catalyst: Add support for OpenCL X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ceb02c00ff88624f900fa4203745d5ce535b87b7;p=buildroot.git package/amd-catalyst: Add support for OpenCL The AMD Catalyst Linux driver includes OpenCL libraries for GPGPU computing. This commits adds support to install the binary blobs and ICD profiles. Signed-off-by: Romain Perier Reviewed-by: "Yann E. MORIN" Signed-off-by: Thomas Petazzoni --- diff --git a/package/amd-catalyst/Config.in b/package/amd-catalyst/Config.in index 55099accf0..96e7f06481 100644 --- a/package/amd-catalyst/Config.in +++ b/package/amd-catalyst/Config.in @@ -73,4 +73,10 @@ config BR2_PACKAGE_AMD_CATALYST_MODULE help Builds and install the fglrx kernel module +config BR2_PACKAGE_AMD_CATALYST_OPENCL + bool "OpenCL support" + help + Installs the OpenCL binary blobs and the ICD profile + for GPGPU computing. + endif # BR2_PACKAGE_AMD_CATALYST diff --git a/package/amd-catalyst/amd-catalyst.mk b/package/amd-catalyst/amd-catalyst.mk index 07eb0faf7f..30973534b2 100644 --- a/package/amd-catalyst/amd-catalyst.mk +++ b/package/amd-catalyst/amd-catalyst.mk @@ -41,6 +41,29 @@ AMD_CATALYST_POST_PATCH_HOOKS += AMD_CATALYST_PREPARE_MODULE $(eval $(kernel-module)) endif +ifeq ($(BR2_PACKAGE_AMD_CATALYST_OPENCL),y) + +AMD_CATALYST_OCL_SUFFIX = $(if $(BR2_x86_64),64,32) +AMD_CATALYST_OPENCL_FILES = \ + libOpenCL.so.1 \ + libaticalcl.so \ + libamdocl$(AMD_CATALYST_OCL_SUFFIX).so \ + libamdocl12cl$(AMD_CATALYST_OCL_SUFFIX).so + +define AMD_CATALYST_INSTALL_OPENCL + $(foreach f,$(AMD_CATALYST_OPENCL_FILES), \ + $(INSTALL) -D -m 0755 $(AMD_CATALYST_ARCH_DIR)/usr/lib$(AMD_CATALYST_LIB_SUFFIX)/$(f) $(TARGET_DIR)/usr/lib/$(f) + ) + ln -sf libOpenCL.so.1 \ + $(TARGET_DIR)/usr/lib/libOpenCL.so + $(INSTALL) -m 0755 $(AMD_CATALYST_ARCH_DIR)/usr/bin/clinfo \ + $(TARGET_DIR)/usr/bin/clinfo + $(INSTALL) -D -m 0644 $(AMD_CATALYST_ARCH_DIR)/etc/OpenCL/vendors/amdocl$(AMD_CATALYST_OCL_SUFFIX).icd \ + $(TARGET_DIR)/etc/OpenCL/vendors/amdocl$(AMD_CATALYST_OCL_SUFFIX).icd +endef + +endif + ifeq ($(BR2_PACKAGE_AMD_CATALYST_XORG), y) # GL headers are needed by any package that wants to use libgl, so they need to @@ -145,6 +168,7 @@ define AMD_CATALYST_INSTALL_TARGET_CMDS $(call AMD_CATALYST_INSTALL_XORG) $(call AMD_CATALYST_INSTALL_CMDLINE_TOOLS) $(call AMD_CATALYST_INSTALL_CCCLE) + $(call AMD_CATALYST_INSTALL_OPENCL) endef $(eval $(generic-package))