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

SYCL: preserve address space by using sycl::global_ptr where sensible #4396

Merged
merged 1 commit into from
Mar 2, 2022

Conversation

masterleinad
Copy link
Contributor

Try to minimize generic space operations

@masterleinad masterleinad force-pushed the sycl_preserve_address_space branch 2 times, most recently from d321bfb to 758548c Compare February 14, 2022 17:59
@masterleinad masterleinad marked this pull request as ready for review February 14, 2022 17:59
@masterleinad masterleinad changed the title [WIP] SYCL: preserve address space SYCL: preserve address space by using sycl::global_ptr where sensible Feb 14, 2022
@masterleinad masterleinad force-pushed the sycl_preserve_address_space branch 2 times, most recently from 93f25a5 to 96e00d4 Compare February 23, 2022 13:47
Copy link
Member

@dalg24 dalg24 left a comment

Choose a reason for hiding this comment

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

Looks good once you clarified removal of the first pointer to scratch memory in team policy specializations of the parallel patterns

char* const scratch_ptr[2] = {m_scratch_ptr[0], m_scratch_ptr[1]};
const auto shmem_begin = m_shmem_begin;
const int scratch_size[2] = {m_scratch_size[0], m_scratch_size[1]};
sycl::global_ptr<char> const global_scratch_ptr = m_global_scratch_ptr;
Copy link
Member

Choose a reason for hiding this comment

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

Can you comment about that change? We were not using scratch_ptr[0]?

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, we are only using scratch_ptr[1] which gets global memory assigned in the constructor. In Cuda and HIP, we set both pointers in the constructor but in SYCL we can only interact with local memory close to kernel execution which is why we always used a different variable for it.

@dalg24 dalg24 merged commit d572c44 into kokkos:develop Mar 2, 2022
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.

None yet

4 participants