Skip to content

[SYCL][USM] Enable per-context USM behavior. Use PI interfaces and avoid directly calling CL inside SYCL RT. #517

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

Merged
merged 6 commits into from
Aug 22, 2019

Conversation

jbrodman
Copy link
Contributor

@jbrodman jbrodman commented Aug 15, 2019

USM Impl now goes through a USMDispatcher class tied to a context. USMDispatcher provides the single location to map to low-level APIs.

Add tests for multi-context behavior. These tests only run if both a CPU and GPU are found.

Replaces #467

@bader bader requested a review from romanovvlad August 16, 2019 11:58
Signed-off-by: James Brodman <[email protected]>

Initial commit for rewriting USM to support PI and multiple contexts.

Signed-off-by: James Brodman <[email protected]>

Update CLUSM test. clext test no longer relevant.

Signed-off-by: James Brodman <[email protected]>
@@ -11,24 +11,23 @@ bool findPlatformAndDevice(cl_device_type deviceType,
cl_int errorCode;

errorCode = clGetPlatformIDs(0, nullptr, &numPlatforms);
if (errorCode != CL_SUCCESS) return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you removing check. Does it make sense to continue if this call fails?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Error checking was causing problems. Those slipped out.

Signed-off-by: James Brodman <[email protected]>
Signed-off-by: James Brodman <[email protected]>
Copy link
Contributor

@romanovvlad romanovvlad left a comment

Choose a reason for hiding this comment

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

LGTM.

void *ParamValue, size_t *ParamValueSizeRet);

private:
bool mEmulated = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably instead of having this var you can check if mEmulator is nullptr or not.


void *hostMemAlloc(pi_context Context, cl_mem_properties_intel *Properties,
size_t Size, pi_uint32 Alignment, pi_result *ErrcodeRet);
void *deviceMemAlloc(pi_context Context, pi_device Device,
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you going to move these functions to pi.hpp/pi.cpp ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I think it's better to keep them here as we need some state (the CLUSM object). In some sense the Dispatcher is separate piece of PI. It's easy to wire new backends up here.

@bader bader merged commit e339962 into intel:sycl Aug 22, 2019
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.

3 participants