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

Re-enabling narrowing errors #1144

Merged
merged 4 commits into from
Oct 8, 2024

Conversation

ellnor01
Copy link
Contributor

@ellnor01 ellnor01 commented Feb 3, 2021

Fixes narrowing conversion build errors in test_common

Removing disable of narrowing errors in main CMakeLists.txt
and moving it down to specific test_conformance suite's
CMakeLists.txt where there are many more build errors revealed
from this fix.

Fixes a few simple issues under test_conformance in the process.

Contributes #787

Signed-off-by: Ellen Norris-Thompson ellen.norris-thompson@arm.com

@ellnor01
Copy link
Contributor Author

Any comments on here?

@kpet
Copy link
Contributor

kpet commented Jul 3, 2024

@ahesham-arm This is failing the CI. It may require a rebase and/or fixes.

@ahesham-arm ahesham-arm force-pushed the narrowing_conversion_1 branch 3 times, most recently from 08da74d to 2b418b0 Compare July 7, 2024 14:15
@ahesham-arm
Copy link
Contributor

@kpet Rebased and all CI checks are now passing.

@@ -274,7 +274,7 @@ struct CommandBufferPrintfTest : public BasicCommandBufferTest
&pattern[0], 0, nullptr, nullptr);
test_error(error, "clEnqueueWriteBuffer failed");

cl_int offset[] = { 0, pattern.size() - 1 };
size_t offset[] = { 0, pattern.size() - 1 };
error = clEnqueueWriteBuffer(queue, off_mem, CL_TRUE, 0, sizeof(offset),
offset, 0, nullptr, nullptr);
test_error(error, "clEnqueueWriteBuffer failed");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

off_mem is created for sizeof(cl_int) size so I think the enqueuewritebuffer to it using sizeof(size_t) can cause issues.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now using cl_uint for the type of the array and an assert is added to ensure the casting is safe.

@@ -115,7 +115,8 @@ struct CreateCommandBufferRepeatedProperties : public BasicCommandBufferTest
TEST_FAIL);

cl_command_buffer_properties_khr invalid_properties[3] = {
CL_COMMAND_BUFFER_FLAGS_KHR, CL_INVALID_PROPERTY, 0
CL_COMMAND_BUFFER_FLAGS_KHR,
(cl_command_buffer_properties_khr)CL_INVALID_PROPERTY, 0
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure CL_INVALID_PROPERTY can be used in a property list like this. The spec only specifies its usage as a return value.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have used -1 instead.

Copy link
Contributor

@lakshmih lakshmih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments

Fixes narrowing conversion build errors in test_common

Removing disable of narrowing errors in main CMakeLists.txt
and moving it down to test_conformance CMakeLists.txt where
there are many more build errors revealed from this fix

Contributes KhronosGroup#787

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
Moves -Wno-narrowing down to only run on suites with
many narrowing errors.

Includes some quick fixes for one-off errors this caused.

Contributes KhronosGroup#787

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
Includes fix for MacOS build error

Contributes KhronosGroup#787

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
Contributes KhronosGroup#787

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
@bashbaug
Copy link
Contributor

bashbaug commented Oct 8, 2024

Merging as discussed in the October 8th teleconference.

@bashbaug bashbaug merged commit 617e7cb into KhronosGroup:main Oct 8, 2024
7 checks passed
@ahesham-arm ahesham-arm deleted the narrowing_conversion_1 branch October 8, 2024 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants