KhronosGroup / KhronosGroup/OpenCL-CLHPP

When SSE is enabled, the compilation fails with VS2015

Open
#33 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
425
Forks
133
Avg merge
3h 30m
Merged PRs (30d)
1

Description

When including cl.hpp, we have the following errors:

CL/cl.hpp(6044): error C2719: 'fillColor': formal parameter with requested alignment of 16 won't be aligned
CL/cl.hpp(6078): error C2719: 'fillColor': formal parameter with requested alignment of 16 won't be aligned

These, I think, are linked to the type cl_int4 which is a union that contains `__cl_int4 v4;` when `__CL_INT4__` is defined, itself defined if `__SSE2__` is defined.
I guess that `__m128i` variables must be aligned, which cannot be done in function parameters on VS.

The workaround that we use is to change the fillcolor parameter from a `cl_int4` to a `const cl_int4&`. Then it compiles fine.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in cl.hpp around lines 6044 and 6078, where fillColor is passed as cl_int4, and compare the __cl_int4/__m128i alignment path enabled by __SSE2__. Verify the parameter handling by compiling with SSE enabled under VS2015 and confirming both reported errors disappear.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.