The Wayback Machine - https://web.archive.org/web/20201128060417/https://github.com/google/clspv/issues/587
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About "error: structures may not contain pointers" #587

Open
fynv opened this issue May 15, 2020 · 1 comment
Open

About "error: structures may not contain pointers" #587

fynv opened this issue May 15, 2020 · 1 comment

Comments

@fynv
Copy link

@fynv fynv commented May 15, 2020

The code that generated the error:
`
struct Params
{
__global const float* arr_in;
__global float* arr_out;
};

__kernel void foo(__constant struct Params* p)
{
int idx = (int)get_global_id(0);
p->arr_out[idx] = 1025.0 - p->arr_in[idx];
}
`
I know that in OpenCL 1.2, structures that are used as kernel paramters cannot contain pointer.
However, I also notice that clspv has started to support C++ so I assume clspv doesn't stick to the OpenCL 1.2 restrictions?

Here if we consider the extensions "GL_EXT_buffer_reference" and "GL_EXT_buffer_reference2", IMO it makes sense for clspv to remove the restriction in question, because it is possible to interpret the pointer members of a parameter struct as buffer references, and user is expected to attach VkDeviceAddress values to these fields.

However, I don't know much about compilers. I guess the actual implementation might be tricky.

@alan-baker
Copy link
Collaborator

@alan-baker alan-baker commented May 19, 2020

There are no near term plans to implement support for SPV_KHR_physical_storage_buffer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.