Skip to content

Commit 76f8149

Browse files
committed
Merge branch 'main' into cl_khr_unified_svm
2 parents 249ec72 + 64c5adb commit 76f8149

File tree

136 files changed

+235
-153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+235
-153
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2019-2024 Ben Ashbaugh
1+
# Copyright (c) 2019-2025 Ben Ashbaugh
22
#
33
# SPDX-License-Identifier: MIT
44

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019-2024 Ben Ashbaugh
3+
Copyright (c) 2019-2025 Ben Ashbaugh
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

docs/env/ubuntu/24.04.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Ubuntu 24.04 Setup Instructions
2+
3+
## Verify Hardware Support
4+
5+
Most modern GPUs support OpenCL. For integrated graphics devices (iGPUs), use `lscpu` to get the processor SKU. Detailed information for Intel SKUs is available from [ark.intel.com](ark.intel.com). Detailed information for AMD processors is available from [AMD's product page](https://www.amd.com/en/products/specifications/processors).
6+
7+
## Build Dependencies
8+
9+
OCL Headers:
10+
11+
```bash
12+
sudo apt install opencl-c-headers opencl-clhpp-headers
13+
```
14+
15+
The OpenCL API has its own set of header files; the above command installs both C and C++ headers files. The C header can be found in `<CL/cl.h>`; the C++ header is in `<CL/opencl.hpp>`.
16+
17+
OCL ICD Loader:
18+
19+
```bash
20+
sudo apt install ocl-icd-opencl-dev
21+
```
22+
23+
OpenCL applications generally link against an OpenCL Installable Compute Device (ICD) loader instead of a specific OpenCL implementation; see [https://github.com/bashbaug/OpenCLPapers/blob/master/OpenCLOnLinux.asciidoc](https://github.com/bashbaug/OpenCLPapers/blob/master/OpenCLOnLinux.asciidoc) for more information about this system.
24+
25+
## Runtime Dependencies
26+
27+
OpenCL requires a compute runtime to manage the interaction between the OpenCL API and the GPU.
28+
29+
### OCL ICD Loader
30+
31+
```bash
32+
sudo apt install ocl-icd-libopencl1
33+
```
34+
35+
OpenCL applications generally link against an OpenCL Installable Compute Device (ICD) loader instead of a specific OpenCL implementation; see [https://github.com/bashbaug/OpenCLPapers/blob/master/OpenCLOnLinux.asciidoc](https://github.com/bashbaug/OpenCLPapers/blob/master/OpenCLOnLinux.asciidoc) for more information about this system.
36+
37+
### AMD Compute Runtime
38+
39+
AMD supports OpenCL through their ROCm platform. Installation instructions are [here](https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html#ubuntu).
40+
41+
### Intel Compute Runtime
42+
43+
Intel's OpenCL support is provided through the NEO compute runtime. Download packages from the project's [GitHub releases page](https://github.com/intel/compute-runtime/releases).
44+
45+
### Nvidia Compute Runtime
46+
47+
Nvidia provides OpenCL support through their proprietary driver, available from the [graphics-drivers PPA](https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa).
48+
49+
```bash
50+
sudo add-apt-repository ppa:graphics-drivers/ppa
51+
sudo apt update
52+
sudo apt install nvidia-graphics-drivers-<version>
53+
```
54+
55+
### Configure Permissions
56+
57+
```bash
58+
sudo usermod -a -G video $USER
59+
sudo usermod -a -G render $USER
60+
```
61+
62+
Users running OpenCL applications on a GPU require additional permissions granted by the groups above.
63+
64+
## Verification
65+
66+
The `clinfo` utility can be used to verify the environment has been properly configured.
67+
68+
```bash
69+
$ sudo apt install clinfo
70+
$ clinfo
71+
<platform information should show here>
72+
```
73+
74+
## Troubleshooting
75+
76+
If `clinfo` indicates there are 0 supported platforms:
77+
78+
1. Verify your host has OpenCL-capable hardware attached
79+
2. Verify clinfo is running as a user with appropriate group membership
80+
3. Verify new group membership has been applied (this may require logout or reboot)
81+
4. Verify the correct compute runtime is installed
82+
5. Check the kernel log (`sudo dmesg`) for related errors

include/CL/opencl.hpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2458,7 +2458,7 @@ class Device : public detail::Wrapper<cl_device_id>
24582458
getInfo(cl_int* err = nullptr) const
24592459
{
24602460
typename detail::param_traits<
2461-
detail::cl_device_info, name>::param_type param;
2461+
detail::cl_device_info, name>::param_type param{};
24622462
cl_int result = getInfo(name, &param);
24632463
if (err != nullptr) {
24642464
*err = result;
@@ -2717,7 +2717,7 @@ class Platform : public detail::Wrapper<cl_platform_id>
27172717
getInfo(cl_int* err = nullptr) const
27182718
{
27192719
typename detail::param_traits<
2720-
detail::cl_platform_info, name>::param_type param;
2720+
detail::cl_platform_info, name>::param_type param{};
27212721
cl_int result = getInfo(name, &param);
27222722
if (err != nullptr) {
27232723
*err = result;
@@ -3406,7 +3406,7 @@ class Context
34063406
getInfo(cl_int* err = nullptr) const
34073407
{
34083408
typename detail::param_traits<
3409-
detail::cl_context_info, name>::param_type param;
3409+
detail::cl_context_info, name>::param_type param{};
34103410
cl_int result = getInfo(name, &param);
34113411
if (err != nullptr) {
34123412
*err = result;
@@ -3489,7 +3489,7 @@ class Context
34893489
cl_int* err = nullptr) const
34903490
{
34913491
typename detail::param_traits<
3492-
detail::cl_image_requirements_info_ext, type>::param_type param;
3492+
detail::cl_image_requirements_info_ext, type>::param_type param{};
34933493
cl_int result = getImageRequirementsInfoExt(type, &param, flags, properties, image_format, image_desc);
34943494
if (err != nullptr) {
34953495
*err = result;
@@ -3607,7 +3607,7 @@ class Event : public detail::Wrapper<cl_event>
36073607
getInfo(cl_int* err = nullptr) const
36083608
{
36093609
typename detail::param_traits<
3610-
detail::cl_event_info, name>::param_type param;
3610+
detail::cl_event_info, name>::param_type param{};
36113611
cl_int result = getInfo(name, &param);
36123612
if (err != nullptr) {
36133613
*err = result;
@@ -3630,7 +3630,7 @@ class Event : public detail::Wrapper<cl_event>
36303630
getProfilingInfo(cl_int* err = nullptr) const
36313631
{
36323632
typename detail::param_traits<
3633-
detail::cl_profiling_info, name>::param_type param;
3633+
detail::cl_profiling_info, name>::param_type param{};
36343634
cl_int result = getProfilingInfo(name, &param);
36353635
if (err != nullptr) {
36363636
*err = result;
@@ -3796,7 +3796,7 @@ class Memory : public detail::Wrapper<cl_mem>
37963796
getInfo(cl_int* err = nullptr) const
37973797
{
37983798
typename detail::param_traits<
3799-
detail::cl_mem_info, name>::param_type param;
3799+
detail::cl_mem_info, name>::param_type param{};
38003800
cl_int result = getInfo(name, &param);
38013801
if (err != nullptr) {
38023802
*err = result;
@@ -4709,7 +4709,7 @@ class Image : public Memory
47094709
getImageInfo(cl_int* err = nullptr) const
47104710
{
47114711
typename detail::param_traits<
4712-
detail::cl_image_info, name>::param_type param;
4712+
detail::cl_image_info, name>::param_type param{};
47134713
cl_int result = getImageInfo(name, &param);
47144714
if (err != nullptr) {
47154715
*err = result;
@@ -5577,7 +5577,7 @@ class Pipe : public Memory
55775577
getInfo(cl_int* err = nullptr) const
55785578
{
55795579
typename detail::param_traits<
5580-
detail::cl_pipe_info, name>::param_type param;
5580+
detail::cl_pipe_info, name>::param_type param{};
55815581
cl_int result = getInfo(name, &param);
55825582
if (err != nullptr) {
55835583
*err = result;
@@ -5684,7 +5684,7 @@ class Sampler : public detail::Wrapper<cl_sampler>
56845684
getInfo(cl_int* err = nullptr) const
56855685
{
56865686
typename detail::param_traits<
5687-
detail::cl_sampler_info, name>::param_type param;
5687+
detail::cl_sampler_info, name>::param_type param{};
56885688
cl_int result = getInfo(name, &param);
56895689
if (err != nullptr) {
56905690
*err = result;
@@ -5892,7 +5892,7 @@ class Kernel : public detail::Wrapper<cl_kernel>
58925892
getInfo(cl_int* err = nullptr) const
58935893
{
58945894
typename detail::param_traits<
5895-
detail::cl_kernel_info, name>::param_type param;
5895+
detail::cl_kernel_info, name>::param_type param{};
58965896
cl_int result = getInfo(name, &param);
58975897
if (err != nullptr) {
58985898
*err = result;
@@ -5914,7 +5914,7 @@ class Kernel : public detail::Wrapper<cl_kernel>
59145914
getArgInfo(cl_uint argIndex, cl_int* err = nullptr) const
59155915
{
59165916
typename detail::param_traits<
5917-
detail::cl_kernel_arg_info, name>::param_type param;
5917+
detail::cl_kernel_arg_info, name>::param_type param{};
59185918
cl_int result = getArgInfo(argIndex, name, &param);
59195919
if (err != nullptr) {
59205920
*err = result;
@@ -5938,7 +5938,7 @@ class Kernel : public detail::Wrapper<cl_kernel>
59385938
getWorkGroupInfo(const Device& device, cl_int* err = nullptr) const
59395939
{
59405940
typename detail::param_traits<
5941-
detail::cl_kernel_work_group_info, name>::param_type param;
5941+
detail::cl_kernel_work_group_info, name>::param_type param{};
59425942
cl_int result = getWorkGroupInfo(device, name, &param);
59435943
if (err != nullptr) {
59445944
*err = result;
@@ -6772,7 +6772,7 @@ class Program : public detail::Wrapper<cl_program>
67726772
getInfo(cl_int* err = nullptr) const
67736773
{
67746774
typename detail::param_traits<
6775-
detail::cl_program_info, name>::param_type param;
6775+
detail::cl_program_info, name>::param_type param{};
67766776
cl_int result = getInfo(name, &param);
67776777
if (err != nullptr) {
67786778
*err = result;
@@ -6795,7 +6795,7 @@ class Program : public detail::Wrapper<cl_program>
67956795
getBuildInfo(const Device& device, cl_int* err = nullptr) const
67966796
{
67976797
typename detail::param_traits<
6798-
detail::cl_program_build_info, name>::param_type param;
6798+
detail::cl_program_build_info, name>::param_type param{};
67996799
cl_int result = getBuildInfo(device, name, &param);
68006800
if (err != nullptr) {
68016801
*err = result;
@@ -6828,7 +6828,7 @@ class Program : public detail::Wrapper<cl_program>
68286828

68296829
for (const cl::Device &d : devs) {
68306830
typename detail::param_traits<
6831-
detail::cl_program_build_info, name>::param_type param;
6831+
detail::cl_program_build_info, name>::param_type param{};
68326832
result = getBuildInfo(d, name, &param);
68336833
devInfo.push_back(
68346834
std::pair<cl::Device, typename detail::param_traits<detail::cl_program_build_info, name>::param_type>
@@ -7615,7 +7615,7 @@ class CommandQueue : public detail::Wrapper<cl_command_queue>
76157615
getInfo(cl_int* err = nullptr) const
76167616
{
76177617
typename detail::param_traits<
7618-
detail::cl_command_queue_info, name>::param_type param;
7618+
detail::cl_command_queue_info, name>::param_type param{};
76197619
cl_int result = getInfo(name, &param);
76207620
if (err != nullptr) {
76217621
*err = result;
@@ -9286,7 +9286,7 @@ class DeviceCommandQueue : public detail::Wrapper<cl_command_queue>
92869286
getInfo(cl_int* err = nullptr) const
92879287
{
92889288
typename detail::param_traits<
9289-
detail::cl_command_queue_info, name>::param_type param;
9289+
detail::cl_command_queue_info, name>::param_type param{};
92909290
cl_int result = getInfo(name, &param);
92919291
if (err != nullptr) {
92929292
*err = result;
@@ -10782,7 +10782,7 @@ class CommandBuffer : public detail::Wrapper<cl_command_buffer_khr>
1078210782
getInfo(cl_int* err = nullptr) const
1078310783
{
1078410784
typename detail::param_traits<
10785-
detail::cl_command_buffer_info_khr, name>::param_type param;
10785+
detail::cl_command_buffer_info_khr, name>::param_type param{};
1078610786
cl_int result = getInfo(name, &param);
1078710787
if (err != nullptr) {
1078810788
*err = result;

include/getenv_util.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
// Copyright (c) 2022-2024 Ben Ashbaugh
2+
// Copyright (c) 2022-2025 Ben Ashbaugh
33
//
44
// SPDX-License-Identifier: MIT
55
*/

include/layer_util.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
// Copyright (c) 2022-2024 Ben Ashbaugh
2+
// Copyright (c) 2022-2025 Ben Ashbaugh
33
//
44
// SPDX-License-Identifier: MIT
55
*/

include/util.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
// Copyright (c) 2021-2024 Ben Ashbaugh
2+
// Copyright (c) 2021-2025 Ben Ashbaugh
33
//
44
// SPDX-License-Identifier: MIT
55
*/

layers/00_example/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2022-2024 Ben Ashbaugh
1+
# Copyright (c) 2022-2025 Ben Ashbaugh
22
#
33
# SPDX-License-Identifier: MIT
44

layers/00_example/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
// Copyright (c) 2022-2024 Ben Ashbaugh
2+
// Copyright (c) 2022-2025 Ben Ashbaugh
33
//
44
// SPDX-License-Identifier: MIT
55
*/

layers/10_cmdbufemu/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2022-2024 Ben Ashbaugh
1+
# Copyright (c) 2022-2025 Ben Ashbaugh
22
#
33
# SPDX-License-Identifier: MIT
44

0 commit comments

Comments
 (0)