Page MenuHome

In Cycles, OpenCL get_device_extension limited
ClosedPublic

Authored by Matt McClellan (mlmcclel) on Sep 26 2020, 9:53 PM.

Details

Summary

In get_device_extensions in opencl_util.cpp, the extension string is currently limited to 1024 characters. Any devices with an extension string longer that 1024 will be lost. The fix is similar to shat is needed for OpenGL. As an example the current Intel OpenCL device string is longer than 1024 chars.

Diff Detail

Event Timeline

Matt McClellan (mlmcclel) requested review of this revision.Sep 26 2020, 9:53 PM
Matt McClellan (mlmcclel) created this revision.

it doesnt violate 1.2 spec https://www.khronos.org/registry/OpenCL/sdk/1.2/docs/man/xhtml/clGetDeviceInfo.html and 1024 should be more flexible, agree

intern/cycles/device/opencl/opencl_util.cpp
1200

do we need to delete as we continue referencing pointer by device_extension?

intern/cycles/device/opencl/opencl_util.cpp
1187

Use vector<char> instead of new/delete.

1200

The buffer contents is copied into the device_extensions string, so it should be deleted.

intern/cycles/device/opencl/opencl_util.cpp
1200

good point , agree

Matt McClellan (mlmcclel) marked an inline comment as done.

Updated with vector<char> for the buffer.

Matt McClellan (mlmcclel) marked 3 inline comments as done.Oct 3 2020, 12:42 AM
This revision is now accepted and ready to land.Oct 5 2020, 2:01 PM