Skip to content

Enable use of default platform context extension #627

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 3 commits into from
Oct 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ jobs:
run: |
# echo "libintelocl.so" | tee /etc/OpenCL/vendors/intel-cpu.icd
export OCL_ICD_FILENAMES=libintelocl.so
export SYCL_ENABLE_HOST_DEVICE=1
# clinfo -l
python -m pytest --pyargs $MODULE_NAME

Expand Down Expand Up @@ -208,7 +209,9 @@ jobs:
- name: Add library
run: echo "OCL_ICD_FILENAMES=C:\Miniconda\Library\lib\intelocl64.dll" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Run tests
run: python -m pytest --pyargs ${{ env.MODULE_NAME }}
run: |
set SYCL_ENABLE_HOST_DEVICE=1
python -m pytest --pyargs ${{ env.MODULE_NAME }}

upload_linux:
needs: test_linux
Expand Down
10 changes: 9 additions & 1 deletion dpctl-capi/source/dpctl_sycl_device_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,15 @@ struct DeviceCacheBuilder
for (const auto &D : Devices) {
if (mRanker(D) < 0)
continue;
auto entry = cache_l.emplace(D, D);

// Per https://github.com/intel/llvm/blob/sycl/sycl/doc/
// extensions/PlatformContext/PlatformContext.adoc
// sycl::queue(D) would create default platform context
// for capable compiler, sycl::context(D) otherwise
auto Q = queue(D);
auto Ctx = Q.get_context();
auto entry = cache_l.emplace(D, Ctx);

if (!entry.second) {
std::cerr << "Fatal Error during device cache "
"construction.\n";
Expand Down
2 changes: 1 addition & 1 deletion dpctl/tests/test_sycl_usm.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def test_pickling_reconstructor_invalid_type(memory_ctor):
mobj = memory_ctor(1024, alignment=64)
good_pickle_bytes = pickle.dumps(mobj)
usm_types = expected_usm_type(memory_ctor).encode("utf-8")
i = good_pickle_bytes.index(usm_types)
i = good_pickle_bytes.rfind(usm_types)
bad_pickle_bytes = good_pickle_bytes[:i] + b"u" + good_pickle_bytes[i + 1 :]
with pytest.raises(ValueError):
pickle.loads(bad_pickle_bytes)
Expand Down