Skip to content

Commit

Permalink
Merge branch 'main' into use_of_cached_queue
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderKalistratov authored Apr 10, 2023
2 parents 9d8ae9e + dc25504 commit 1d14e97
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 38 deletions.
40 changes: 5 additions & 35 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,17 @@ jobs:
run: |
source $CONDA/etc/profile.d/conda.sh
conda activate numba_dpex_env
export OCL_ICD_FILENAMES=libintelocl.so
python -c "import dpnp"
- name: Check dpcpp-llvm-spirv
run: |
source $CONDA/etc/profile.d/conda.sh
conda activate numba_dpex_env
export OCL_ICD_FILENAMES=libintelocl.so
python -c "import dpcpp_llvm_spirv as p; print(p.get_llvm_spirv_path())"
- name: Run tests
run: |
source $CONDA/etc/profile.d/conda.sh
conda activate numba_dpex_env
# echo "libintelocl.so" | tee /etc/OpenCL/vendors/intel-cpu.icd
export OCL_ICD_FILENAMES=libintelocl.so
python -m pytest -q -ra --disable-warnings --pyargs $MODULE_NAME -vv
- name: Run examples
run: |
Expand All @@ -151,7 +148,6 @@ jobs:
source $CONDA/etc/profile.d/conda.sh
conda activate numba_dpex_env
# echo "libintelocl.so" | tee /etc/OpenCL/vendors/intel-cpu.icd
export OCL_ICD_FILENAMES=libintelocl.so
for script in $(find . \( -not -name "_*" -not -name "vector_sum2D.py" -not -name "vectorize.py" -not -name "scan.py" -and -name "*.py" \))
do
echo "Executing ${script}"
Expand Down Expand Up @@ -222,37 +218,11 @@ jobs:
- name: Add library
shell: pwsh
run: |
$conda_env_library = "$env:CONDA_PREFIX\Library"
echo "OCL_ICD_FILENAMES=$conda_env_library\lib\intelocl64.dll" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
try {$list = Get-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors | Select-Object -ExpandProperty Property } catch {$list=@()}
if ($list.count -eq 0) {
if (-not (Test-Path -Path HKLM:\SOFTWARE\Khronos)) {
New-Item -Path HKLM:\SOFTWARE\Khronos
}
if (-not (Test-Path -Path HKLM:\SOFTWARE\Khronos\OpenCL)) {
New-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL
}
if (-not (Test-Path -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors)) {
New-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors
}
New-ItemProperty -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors -Name $conda_env_library\lib\intelocl64.dll -Value 0
try {$list = Get-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors | Select-Object -ExpandProperty Property } catch {$list=@()}
Write-Output $(Get-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors)
# Now copy OpenCL.dll into system folder
$system_ocl_icd_loader="C:\Windows\System32\OpenCL.dll"
$python_ocl_icd_loader="$conda_env_library\bin\OpenCL.dll"
Copy-Item -Path $python_ocl_icd_loader -Destination $system_ocl_icd_loader
if (Test-Path -Path $system_ocl_icd_loader) {
Write-Output "$system_ocl_icd_loader has been copied"
$acl = Get-Acl $system_ocl_icd_loader
Write-Output $acl
} else {
Write-Output "OCL-ICD-Loader was not copied"
}
# Variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default
$cl_cfg="$conda_env_library\lib\cl.cfg"
(Get-Content $cl_cfg) -replace '^CL_CONFIG_TBB_DLL_PATH =', "CL_CONFIG_TBB_DLL_PATH = $conda_env_library\bin" | Set-Content $cl_cfg
}
$script_path="$env:CONDA_PREFIX\Scripts\set-intel-ocl-icd-registry.ps1"
&$script_path
# Check the variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default
$cl_cfg="$env:CONDA_PREFIX\Library\lib\cl.cfg"
Get-Content -Tail 5 -Path $cl_cfg
- name: Add dpnp skip variable
run: echo "NUMBA_DPEX_TESTING_SKIP_NO_DPNP=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Expand Down
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased] - 2023-03-28
## [0.20.1] - 2023-04-07

### Added
* Replaced llvm_spirv from oneAPI path by dpcpp-llvm-spirv package.
* Replaced llvm_spirv from oneAPI path by dpcpp-llvm-spirv package.(#979)
* Added Dockerfile and a manual workflow to publish pre-built packages to the repo.(#973)

### Fixed
* Fixed default dtype derivation when creating a dpnp.ndarray. (#993)
* Adjusted test_windows step to work with intel-opencl-rt=2023.1.0. (#990)
* Fixed layout in dpnp overload.(#987)
* Handled the case when arraystruct->meminfo is null to close gh-965. (#972)

## [0.20.0] - 2023-03-06

Expand Down Expand Up @@ -59,6 +66,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Update to dpctl 0.14 (#858)
* Update linters: black to 23.1.0, isort to 5.12.0 (#900)
* License in setup.py to match actual project licensing (#904)

### Fixed
* Kernel specialization, compute follows data programming model for
kernels (#804)
Expand Down
2 changes: 1 addition & 1 deletion numba_dpex/core/types/usm_ndarray_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def device_as_string(dev):

if not dtype:
dummy_tensor = dpctl.tensor.empty(
sh=1, order=layout, usm_type=usm_type, sycl_queue=self.queue
shape=1, order=layout, usm_type=usm_type, sycl_queue=self.queue
)
# convert dpnp type to numba/numpy type
_dtype = dummy_tensor.dtype
Expand Down
26 changes: 26 additions & 0 deletions numba_dpex/tests/dpjit_tests/dpnp/test_dpnp_empty.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,29 @@ def func1(shape):
)
else:
c.sycl_device.filter_string == dpctl.SyclDevice().filter_string


@pytest.mark.parametrize("shape", shapes)
def test_dpnp_empty_default_dtype(shape):
@dpjit
def func1(shape):
c = dpnp.empty(shape=shape)
return c

try:
c = func1(shape)
except Exception:
pytest.fail("Calling dpnp.empty inside dpjit failed")

if len(c.shape) == 1:
assert c.shape[0] == shape
else:
assert c.shape == shape

dummy_tensor = dpctl.tensor.empty(shape=1)

assert c.dtype == dummy_tensor.dtype

dummy_tensor = dpctl.tensor.empty(shape)

assert c.dtype == dummy_tensor.dtype

0 comments on commit 1d14e97

Please sign in to comment.