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

Support vectorized Select in OpenGLCompute backend #6371

Merged

Conversation

OmarEmaraDev
Copy link
Contributor

The ternary operator in GLSL does not work with vector types. While the
mix function have overloads to boolean vectors, it is only supported in
version 4.5, so it is not exactly portable. To work around this, we use
the ternary operator on all elements of the vector type.

Necessary for #6348.

The ternary operator in GLSL does not work with vector types. While the
mix function have overloads to boolean vectors, it is only supported in
version 4.5, so it is not exactly portable. To work around this, we use
the ternary operator on all elements of the vector type.

Necessary for halide#6348.
@steven-johnson
Copy link
Contributor

Is there a test case that exercises this? If not, this PR should add one.

@OmarEmaraDev
Copy link
Contributor Author

@steven-johnson Any pointers on how tests for OpenGLCompute should be added? I saw #5627, so I assumed that's is not possible at the moment.
I will be working on advancing and testing the OpenGLCompute backend in the near future, so if testing is something that needs to be addressed first, let me know how we can approach this.

@steven-johnson
Copy link
Contributor

@steven-johnson Any pointers on how tests for OpenGLCompute should be added? I saw #5627, so I assumed that's is not possible at the moment.

Yikes -- I had forgotten we weren't testing these. Not sure if the issues ever got addressed. @shoaibkamil, do you remember the issues here?

@shoaibkamil
Copy link
Contributor

Yes, the issues are related to having two different LLVMs included: one within libhalide, and the other within the OpenGL runtime, both (I believe) having public symbol visibility. @alexreinking had some ideas on how to make this work using cmake, I believe, and may have more info.

I can look into it again later this week, depending on what Alex thinks the right way to do this via cmake is.

@alexreinking
Copy link
Member

Yes, the issues are related to having two different LLVMs included: one within libhalide, and the other within the OpenGL runtime, both (I believe) having public symbol visibility. @alexreinking had some ideas on how to make this work using cmake, I believe, and may have more info.

I thought this was solved (on macOS/Linux) by #5659? Is that not the case?

@shoaibkamil
Copy link
Contributor

I thought this was solved (on macOS/Linux) by #5659? Is that not the case?

Thanks for the reminder, I'll check locally to ensure this is fixed and then try to get it working on the buildbot as well.

@steven-johnson
Copy link
Contributor

@steven-johnson Any pointers on how tests for OpenGLCompute should be added?

OK, since OGLC testing is temporarily busted, go ahead and land this without a test, we'll figure it out later.

@steven-johnson steven-johnson merged commit 26ccb54 into halide:master Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants