Skip to content

Commit 5271fe1

Browse files
Merge pull request #1059 from IntelPython/clean-up-ocl-cpu-rt-activation-step
Clean-up PowerShell script to add registry expected by OpenCL loader
2 parents 8c3f3d5 + d5d7f0a commit 5271fe1

File tree

1 file changed

+16
-21
lines changed

1 file changed

+16
-21
lines changed

.github/workflows/conda-package.yml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -269,28 +269,23 @@ jobs:
269269
- name: Configure Intel OpenCL CPU RT
270270
shell: pwsh
271271
run: |
272-
$conda_env_library = "$env:CONDA_PREFIX\Library"
273-
echo "OCL_ICD_FILENAMES=$conda_env_library\lib\intelocl64.dll" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
274-
try {$list = Get-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors | Select-Object -ExpandProperty Property } catch {$list=@()}
275-
if ($list.count -eq 0) {
276-
if (-not (Test-Path -Path HKLM:\SOFTWARE\Khronos)) {
277-
New-Item -Path HKLM:\SOFTWARE\Khronos
278-
}
279-
if (-not (Test-Path -Path HKLM:\SOFTWARE\Khronos\OpenCL)) {
280-
New-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL
281-
}
282-
if (-not (Test-Path -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors)) {
283-
New-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors
284-
}
285-
New-ItemProperty -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors -Name $conda_env_library\lib\intelocl64.dll -Value 0
286-
try {$list = Get-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors | Select-Object -ExpandProperty Property } catch {$list=@()}
287-
Write-Output $(Get-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors)
288-
# Variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default
289-
$cl_cfg="$conda_env_library\lib\cl.cfg"
290-
Write-Output $cl_cfg
291-
(Get-Content $cl_cfg) -replace '^CL_CONFIG_TBB_DLL_PATH =', "CL_CONFIG_TBB_DLL_PATH = $conda_env_library\bin" | Set-Content $cl_cfg
292-
Get-Content -Tail 5 -Path $cl_cfg
272+
if (-not (Test-Path -Path HKLM:\SOFTWARE\Khronos)) {
273+
New-Item -Path HKLM:\SOFTWARE\Khronos
274+
}
275+
if (-not (Test-Path -Path HKLM:\SOFTWARE\Khronos\OpenCL)) {
276+
New-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL
293277
}
278+
if (-not (Test-Path -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors)) {
279+
New-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors
280+
}
281+
$conda_env_library = "$env:CONDA_PREFIX\Library"
282+
New-ItemProperty -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors -Name $conda_env_library\lib\intelocl64.dll -Value 0
283+
Write-Host $(Get-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors)
284+
# Variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default
285+
$cl_cfg="$conda_env_library\lib\cl.cfg"
286+
Write-Output $cl_cfg
287+
(Get-Content $cl_cfg) -replace '^CL_CONFIG_TBB_DLL_PATH =', "CL_CONFIG_TBB_DLL_PATH = $conda_env_library\bin" | Set-Content $cl_cfg
288+
Get-Content -Tail 5 -Path $cl_cfg
294289
- name: Smoke test, step 1
295290
shell: cmd /C CALL {0}
296291
run: >-

0 commit comments

Comments
 (0)