Skip to contentSkip to conversation

package/opencl-clhpp: new package

PATCH In review Gilles Talis 3 participants 6 messages Jan 16, 2022 – Jul 27, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/opencl-clhpp: new package

opencl-clhpp are the OpenCL API C++ bindings

---
 DEVELOPERS                             |  1 +
 package/Config.in                      |  1 +
 package/opencl-clhpp/Config.in         | 10 ++++++++++
 package/opencl-clhpp/opencl-clhpp.hash |  3 +++
 package/opencl-clhpp/opencl-clhpp.mk   | 16 ++++++++++++++++
 5 files changed, 31 insertions(+)
 create mode 100644 package/opencl-clhpp/Config.in
 create mode 100644 package/opencl-clhpp/opencl-clhpp.hash
 create mode 100644 package/opencl-clhpp/opencl-clhpp.mk
DEVELOPERS +1 -0
index a91e2dfcde..483afa4932 100644
@@ -1084,6 +1084,7 @@ F:	package/libeXosip2/
 F:	package/libolm/
 F:	package/libosip2/
 F:	package/ocrad/
+F:	package/opencl-clhpp/
 F:	package/opusfile/
 F:	package/restclient-cpp/
 F:	package/tesseract-ocr/
package/Config.in +1 -0
index 4df1474b91..08eb3ad809 100644
@@ -1564,6 +1564,7 @@ menu "Graphics"
 	source "package/libvips/Config.in"
 	source "package/libwpe/Config.in"
 	source "package/menu-cache/Config.in"
+	source "package/opencl-clhpp/Config.in"
 	source "package/opencv3/Config.in"
 	source "package/opencv4/Config.in"
 	source "package/opengl/Config.in"
package/opencl-clhpp/Config.in new file +10 -0
new file mode 100644
index 0000000000..12045be055
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_OPENCL_CLHPP
+	bool "opencl-clhpp"
+	depends on BR2_INSTALL_LIBSTDCPP
+	help
+	  opencl-clhpp are the OpenCL API C++ bindings
+
+	  http://github.khronos.org/OpenCL-CLHPP/
+
+comment "opencl-clhpp needs a toolchain w/ C++"
+	depends on !BR2_INSTALL_LIBSTDCPP
package/opencl-clhpp/opencl-clhpp.hash new file +3 -0
new file mode 100644
index 0000000000..27b27cd80c
@@ -0,0 +1,3 @@
+# Locally Computed
+sha256  869456032e60787eed9fceaeaf6c6cb4452bc0ff97e0f5a271510145a1c8f4d4  opencl-clhpp-2.0.16.tar.gz
+sha256  cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30  LICENSE.txt
package/opencl-clhpp/opencl-clhpp.mk new file +16 -0
new file mode 100644
index 0000000000..610cd45b62
@@ -0,0 +1,16 @@
+################################################################################
+#
+# opencl-clhpp
+#
+################################################################################
+
+OPENCL_CLHPP_VERSION = 2.0.16
+OPENCL_CLHPP_SITE = $(call github,KhronosGroup,OpenCL-CLHPP,v$(OPENCL_CLHPP_VERSION))
+OPENCL_CLHPP_LICENSE = Apache-2.0
+OPENCL_CLHPP_LICENSE_FILES = LICENSE.txt
+OPENCL_CLHPP_INSTALL_STAGING = YES
+
+# OpenCL_CLHPP is a header-only library
+OPENCL_CLHPP_INSTALL_TARGET = NO
+
+$(eval $(cmake-package))
Signature · 6 lines
2.32.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH v2 2/2 package/clpeak: new package

clpeak is a tool that profiles OpenCL devices to find their peak capacities

---
v2:
- Added opencl-clhpp dependency

 DEVELOPERS                 |  1 +
 package/Config.in          |  1 +
 package/clpeak/Config.in   | 15 +++++++++++++++
 package/clpeak/clpeak.hash |  3 +++
 package/clpeak/clpeak.mk   | 13 +++++++++++++
 5 files changed, 33 insertions(+)
 create mode 100644 package/clpeak/Config.in
 create mode 100644 package/clpeak/clpeak.hash
 create mode 100644 package/clpeak/clpeak.mk
DEVELOPERS +1 -0
index 483afa4932..04b3f8fba9 100644
@@ -1075,6 +1075,7 @@ N:	Gilles Talis <[email protected]>
 F:	board/freescale/imx8mmevk/
 F:	configs/freescale_imx8mmevk_defconfig
 F:	package/cctz/
+F:	package/clpeak/
 F:	package/faad2/
 F:	package/fdk-aac/
 F:	package/httping/
package/Config.in +1 -0
index 08eb3ad809..b38d05b3b3 100644
@@ -87,6 +87,7 @@ menu "Debugging, profiling and benchmark"
 	source "package/bonnie/Config.in"
 	source "package/cache-calibrator/Config.in"
 	source "package/clinfo/Config.in"
+	source "package/clpeak/Config.in"
 	source "package/coremark/Config.in"
 	source "package/coremark-pro/Config.in"
 	source "package/dacapo/Config.in"
package/clpeak/Config.in new file +15 -0
new file mode 100644
index 0000000000..c83297549c
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_CLPEAK
+	bool "clpeak"
+	depends on BR2_PACKAGE_HAS_LIBOPENCL
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
+	select BR2_PACKAGE_OPENCL_CLHPP
+	help
+	  clpeak is a tool that profiles OpenCL devices
+	  to find their peak capacities
+
+	  https://github.com/krrishnarraj/clpeak
+
+comment "clpeak needs an OpenCL provider, a toolchain w/ C++, gcc >= 4.8"
+	depends on !BR2_PACKAGE_HAS_LIBOPENCL \
+		|| !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
package/clpeak/clpeak.hash new file +3 -0
new file mode 100644
index 0000000000..e0d2c1e92b
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  1e9c3f959498253d6bb956dc786de7b3e4019264216a1781c06ae49a1d6600e5  clpeak-0777205be1d5681d5a76d46ec94588544e8462a5.tar.gz
+sha256  88d9b4eb60579c191ec391ca04c16130572d7eedc4a86daa58bf28c6e14c9bcd  LICENSE
package/clpeak/clpeak.mk new file +13 -0
new file mode 100644
index 0000000000..5fa990fb34
@@ -0,0 +1,13 @@
+################################################################################
+#
+# clpeak
+#
+################################################################################
+
+CLPEAK_VERSION = 0777205be1d5681d5a76d46ec94588544e8462a5
+CLPEAK_SITE = $(call github,krrishnarraj,clpeak,$(CLPEAK_VERSION))
+CLPEAK_LICENSE = Unlicense
+CLPEAK_LICENSE_FILES = LICENSE
+CLPEAK_DEPENDENCIES = libopencl opencl-clhpp
+
+$(eval $(cmake-package))
Signature · 6 lines
2.32.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Reviewed-by on v2 2/2
#2 lore raw

Re: [Buildroot] [PATCH v2 2/2] package/clpeak: new package

Hello Gilles,

Le 16/01/2022 à 18:53, Gilles Talis a écrit :

Quoted 7 lines

clpeak is a tool that profiles OpenCL devices to find their peak capacities

---
v2:
- Added opencl-clhpp dependency

It seems you missed the second part of the review from Thomas about the issue with NXP OpenCL provider:

http://lists.busybox.net/pipermail/buildroot/2021-December/631942.html

But after testing again locally the issue is gone since the Bootlin toolchain has been updated to 2021.11-1 and now use a newer glibc version > 2.33.

Testing again with the previous toolchain [1] the build fail again.

I don't think the issue is really related to clpeak but the imx-gpu-viv package itself. But we don't have a way in the current external toolchain infrastructure to add a dependency on the glibc version provided by the external toolchain.

Otherwise:

[1]
https://toolchains.bootlin.com/downloads/releases/toolchains/aarch64/tarballs/aarch64--glibc--stable-2020.08-1.tar.bz2

Best regards,
Romain

Quoted 74 lines
 DEVELOPERS                 |  1 +
 package/Config.in          |  1 +
 package/clpeak/Config.in   | 15 +++++++++++++++
 package/clpeak/clpeak.hash |  3 +++
 package/clpeak/clpeak.mk   | 13 +++++++++++++
 5 files changed, 33 insertions(+)
 create mode 100644 package/clpeak/Config.in
 create mode 100644 package/clpeak/clpeak.hash
 create mode 100644 package/clpeak/clpeak.mk
DEVELOPERS +1 -0
index 483afa4932..04b3f8fba9 100644
@@ -1075,6 +1075,7 @@ N:	Gilles Talis <[email protected]>
 F:	board/freescale/imx8mmevk/
 F:	configs/freescale_imx8mmevk_defconfig
 F:	package/cctz/
+F:	package/clpeak/
 F:	package/faad2/
 F:	package/fdk-aac/
 F:	package/httping/
package/Config.in +1 -0
index 08eb3ad809..b38d05b3b3 100644
@@ -87,6 +87,7 @@ menu "Debugging, profiling and benchmark"
 	source "package/bonnie/Config.in"
 	source "package/cache-calibrator/Config.in"
 	source "package/clinfo/Config.in"
+	source "package/clpeak/Config.in"
 	source "package/coremark/Config.in"
 	source "package/coremark-pro/Config.in"
 	source "package/dacapo/Config.in"
package/clpeak/Config.in new file +15 -0
new file mode 100644
index 0000000000..c83297549c
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_CLPEAK
+	bool "clpeak"
+	depends on BR2_PACKAGE_HAS_LIBOPENCL
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
+	select BR2_PACKAGE_OPENCL_CLHPP
+	help
+	  clpeak is a tool that profiles OpenCL devices
+	  to find their peak capacities
+
+	  https://github.com/krrishnarraj/clpeak
+
+comment "clpeak needs an OpenCL provider, a toolchain w/ C++, gcc >= 4.8"
+	depends on !BR2_PACKAGE_HAS_LIBOPENCL \
+		|| !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
package/clpeak/clpeak.hash new file +3 -0
new file mode 100644
index 0000000000..e0d2c1e92b
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  1e9c3f959498253d6bb956dc786de7b3e4019264216a1781c06ae49a1d6600e5  clpeak-0777205be1d5681d5a76d46ec94588544e8462a5.tar.gz
+sha256  88d9b4eb60579c191ec391ca04c16130572d7eedc4a86daa58bf28c6e14c9bcd  LICENSE
package/clpeak/clpeak.mk new file +3 -0
new file mode 100644
index 0000000000..5fa990fb34
@@ -0,0 +1,13 @@
+################################################################################
+#
+# clpeak

package/clpeak/clpeak.mk line 13

Quoted 10 lines
package/clpeak/clpeak.mk new file +10 -0
+#
+################################################################################
+
+CLPEAK_VERSION = 0777205be1d5681d5a76d46ec94588544e8462a5
+CLPEAK_SITE = $(call github,krrishnarraj,clpeak,$(CLPEAK_VERSION))
+CLPEAK_LICENSE = Unlicense
+CLPEAK_LICENSE_FILES = LICENSE
+CLPEAK_DEPENDENCIES = libopencl opencl-clhpp
+
+$(eval $(cmake-package))

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

Re: [Buildroot] [PATCH v2 2/2] package/clpeak: new package

In reply to Gilles Talis

Hello Gilles,

Quoted 7 lines · On Sun, 16 Jan 2022 18:53:20 +0100 Gilles Talis <[email protected]> wrote:

clpeak is a tool that profiles OpenCL devices to find their peak capacities

---
v2:
- Added opencl-clhpp dependency

I have applied after updating to the slightly newer tagged release 1.1.2.

Thanks a lot!

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw
In reply to Gilles Talis

Hello Gilles,

Le 16/01/2022 à 18:53, Gilles Talis a écrit :

Quoted 31 lines

opencl-clhpp are the OpenCL API C++ bindings

---
 DEVELOPERS                             |  1 +
 package/Config.in                      |  1 +
 package/opencl-clhpp/Config.in         | 10 ++++++++++
 package/opencl-clhpp/opencl-clhpp.hash |  3 +++
 package/opencl-clhpp/opencl-clhpp.mk   | 16 ++++++++++++++++
 5 files changed, 31 insertions(+)
 create mode 100644 package/opencl-clhpp/Config.in
 create mode 100644 package/opencl-clhpp/opencl-clhpp.hash
 create mode 100644 package/opencl-clhpp/opencl-clhpp.mk
DEVELOPERS +1 -0
index a91e2dfcde..483afa4932 100644
@@ -1084,6 +1084,7 @@ F:	package/libeXosip2/
 F:	package/libolm/
 F:	package/libosip2/
 F:	package/ocrad/
+F:	package/opencl-clhpp/
 F:	package/opusfile/
 F:	package/restclient-cpp/
 F:	package/tesseract-ocr/
package/Config.in +0 -0
index 4df1474b91..08eb3ad809 100644

package/Config.in menu "Graphics" · line 1567

Quoted 4 lines
package/Config.in +1 -0
@@ -1564,6 +1564,7 @@ menu "Graphics"
 	source "package/libvips/Config.in"
 	source "package/libwpe/Config.in"
 	source "package/menu-cache/Config.in"
+	source "package/opencl-clhpp/Config.in"

Is opencl headers should really belong to "Graphics" library menu?

maybe "Hardware handling" or in last resort "other"?

package/opencl-clhpp/Config.in line 3

Quoted 12 lines
package/Config.in +0 -0
 	source "package/opencv3/Config.in"
 	source "package/opencv4/Config.in"
 	source "package/opengl/Config.in"
package/opencl-clhpp/Config.in new file +3 -0
new file mode 100644
index 0000000000..12045be055
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_OPENCL_CLHPP
+	bool "opencl-clhpp"
+	depends on BR2_INSTALL_LIBSTDCPP

The CMake build system requires a C++11 compiler, so a gcc 4.8 or newer is required.

Quoted 28 lines
package/opencl-clhpp/Config.in new file +7 -0
+	help
+	  opencl-clhpp are the OpenCL API C++ bindings
+
+	  http://github.khronos.org/OpenCL-CLHPP/
+
+comment "opencl-clhpp needs a toolchain w/ C++"
+	depends on !BR2_INSTALL_LIBSTDCPP
package/opencl-clhpp/opencl-clhpp.hash new file +3 -0
new file mode 100644
index 0000000000..27b27cd80c
@@ -0,0 +1,3 @@
+# Locally Computed
+sha256  869456032e60787eed9fceaeaf6c6cb4452bc0ff97e0f5a271510145a1c8f4d4  opencl-clhpp-2.0.16.tar.gz
+sha256  cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30  LICENSE.txt
package/opencl-clhpp/opencl-clhpp.mk new file +6 -0
new file mode 100644
index 0000000000..610cd45b62
@@ -0,0 +1,16 @@
+################################################################################
+#
+# opencl-clhpp
+#
+################################################################################
+

package/opencl-clhpp/opencl-clhpp.mk line 16

Quoted 10 lines
package/opencl-clhpp/opencl-clhpp.mk new file +10 -0
+OPENCL_CLHPP_VERSION = 2.0.16
+OPENCL_CLHPP_SITE = $(call github,KhronosGroup,OpenCL-CLHPP,v$(OPENCL_CLHPP_VERSION))
+OPENCL_CLHPP_LICENSE = Apache-2.0
+OPENCL_CLHPP_LICENSE_FILES = LICENSE.txt
+OPENCL_CLHPP_INSTALL_STAGING = YES
+
+# OpenCL_CLHPP is a header-only library
+OPENCL_CLHPP_INSTALL_TARGET = NO
+
+$(eval $(cmake-package))

Since we only build two headers files, is the cmake infra really required?

Install the project...
-- Install configuration: "Release"
-- Installing: output/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/CL -- Installing:
output/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/CL/opencl.hpp -- Installing:
output/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/CL/cl2.hpp

Best regards,
Romain

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#5 lore raw
In reply to Gilles Talis

Hello Gilles,

package/opencl-clhpp/Config.in line 3

Quoted 9 lines · On Sun, 16 Jan 2022 18:53:19 +0100 Gilles Talis <[email protected]> wrote:
package/opencl-clhpp/Config.in new file +3 -0
new file mode 100644
index 0000000000..12045be055
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_OPENCL_CLHPP
+	bool "opencl-clhpp"
+	depends on BR2_INSTALL_LIBSTDCPP

I've added a dependency on BR2_PACKAGE_HAS_LIBOPENCL here. While it is not needed for this package to build (because it now only install headers), all users of opencl-clhpp will need to have this dependency.

Quoted 21 lines
package/opencl-clhpp/opencl-clhpp.hash new file +3 -0
new file mode 100644
index 0000000000..27b27cd80c
@@ -0,0 +1,3 @@
+# Locally Computed
+sha256  869456032e60787eed9fceaeaf6c6cb4452bc0ff97e0f5a271510145a1c8f4d4  opencl-clhpp-2.0.16.tar.gz
+sha256  cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30  LICENSE.txt
package/opencl-clhpp/opencl-clhpp.mk new file +6 -0
new file mode 100644
index 0000000000..610cd45b62
@@ -0,0 +1,16 @@
+################################################################################
+#
+# opencl-clhpp
+#
+################################################################################
+

package/opencl-clhpp/opencl-clhpp.mk line 16

Quoted 10 lines
package/opencl-clhpp/opencl-clhpp.mk new file +10 -0
+OPENCL_CLHPP_VERSION = 2.0.16
+OPENCL_CLHPP_SITE = $(call github,KhronosGroup,OpenCL-CLHPP,v$(OPENCL_CLHPP_VERSION))
+OPENCL_CLHPP_LICENSE = Apache-2.0
+OPENCL_CLHPP_LICENSE_FILES = LICENSE.txt
+OPENCL_CLHPP_INSTALL_STAGING = YES
+
+# OpenCL_CLHPP is a header-only library
+OPENCL_CLHPP_INSTALL_TARGET = NO
+
+$(eval $(cmake-package))

As suggested by Romain, I have used generic-package and a simple OPENCL_CLHPP_INSTALL_STAGING_CMDS to just install the two headers to avoid the need for a C++11 compiler.

Applied with those changes, thanks!

Best regards,

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot