Skip to content

Commit

Permalink
Ww28 pulldown (KhronosGroup#1)
Browse files Browse the repository at this point in the history
* Use macOS 10 in CI (KhronosGroup#1282)

macOS jobs frequently fail. Since macos-11.0 support is considered experimental,
move to macos-10, using macos-latest so we automatically move to 11 when
stable.

See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners

Signed-off-by: Kevin Petit <[email protected]>

* Fix double-release of memory objects (KhronosGroup#1277)

A recent update to the object wrapper classes (KhronosGroup#1268) changed the
behavior of assigning to a wrapper, whereby the wrapped object is now
released upon assignment. A couple of tests were manually calling
clReleaseMemObject and then assigning `nullptr` to the wrapper,
resulting in the wrapper calling clReleaseMemObject on an object that
had already been destroyed.

Co-authored-by: Kévin Petit <[email protected]>
Co-authored-by: James Price <[email protected]>
  • Loading branch information
3 people authored Jul 7, 2021
1 parent 69f0054 commit 38dc17c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
mainmatrix: [true]
os: [ubuntu-20.04, macos-11.0]
os: [ubuntu-20.04, macos-latest]
include:
- os: ubuntu-20.04
mainmatrix: true
Expand Down
7 changes: 0 additions & 7 deletions test_conformance/api/test_mem_object_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,14 +348,7 @@ int test_get_buffer_info( cl_device_id deviceID, cl_context context, cl_command_
TEST_MEM_OBJECT_PARAM( subBufferObject, CL_MEM_ASSOCIATED_MEMOBJECT, origObj, (cl_mem)bufferObject, "associated mem object", "%p", void * )

TEST_MEM_OBJECT_PARAM( subBufferObject, CL_MEM_OFFSET, offset, (size_t)( addressAlign ), "offset", "%ld", size_t )

clReleaseMemObject( subBufferObject );
subBufferObject = NULL;

}

clReleaseMemObject( bufferObject );
bufferObject = NULL;
}

return CL_SUCCESS;
Expand Down
7 changes: 1 addition & 6 deletions test_conformance/api/test_mem_objects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,7 @@ int test_mem_object_destructor_callback_single(clMemWrapper &memObject)
test_error(error, "Unable to set destructor callback");

// Now release the buffer, which SHOULD call the callbacks
error = clReleaseMemObject(memObject);
test_error(error, "Unable to release test buffer");

// Note: since we manually released the mem wrapper, we need to set it to
// NULL to prevent a double-release
memObject = NULL;
memObject.reset();

// At this point, all three callbacks should have already been called
int numErrors = 0;
Expand Down

0 comments on commit 38dc17c

Please sign in to comment.