Skip to content

Use Printf to report errors from POCL #592

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
19 changes: 10 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -32,11 +32,11 @@ jobs:
# - x64
# pocl: [jll,]
include:
- version: '1.10'
os: ubuntu-latest
arch: x64
pocl: local
allow_failure: true
# - version: '1.10'
# os: ubuntu-latest
# arch: x64
# pocl: local
# allow_failure: true
- version: '1.11'
os: ubuntu-latest
arch: x64
@@ -70,7 +70,8 @@ jobs:
if: ${{ matrix.pocl == 'local' }}
uses: actions/checkout@v4
with:
repository: pocl/pocl
repository: pjaaskel/pocl
ref: UnreachableToReturns-fixes
path: pocl
- name: Install system dependencies
if: ${{ matrix.pocl == 'local' }}
@@ -92,9 +93,8 @@ jobs:
"CMake_jll",
])
# versioned
llvm_version = "$(Base.libllvm_version.major).$(Base.libllvm_version.minor)"
Pkg.add(name="LLVM_full_jll", version=llvm_version)
Pkg.add(name="SPIRV_LLVM_Translator_jll", version=llvm_version)'
Pkg.add(name="LLVM_full_jll", version="19")
Pkg.add(name="SPIRV_LLVM_Translator_jll", version="19")'
- name: Build PoCL
if: ${{ matrix.pocl == 'local' }}
run: |
@@ -119,6 +119,7 @@ jobs:
-DCMAKE_C_FLAGS="-fdiagnostics-color=always"
-DCMAKE_BUILD_TYPE=Debug
-DENABLE_TESTS:Bool=OFF
-DSTATIC_LLVM:Bool=On
-DPOCL_DEBUG_MESSAGES:Bool=ON
-DCMAKE_INSTALL_PREFIX=$destdir
-DWITH_LLVM_CONFIG=$(LLVM_full_jll.artifact_dir)/tools/llvm-config
3 changes: 3 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -48,3 +48,6 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[sources]
SPIRVIntrinsics = {url = "https://github.com/JuliaGPU/OpenCL.jl", rev = "master", subdir = "lib/intrinsics"}
20 changes: 10 additions & 10 deletions src/pocl/device/runtime.jl
Original file line number Diff line number Diff line change
@@ -10,23 +10,23 @@
import SPIRVIntrinsics: get_global_id

function report_exception(ex)
# SPIRVIntrinsics.@printf(
# "ERROR: a %s was thrown during kernel execution on thread (%d, %d, %d).\n",
# ex, get_global_id(UInt32(0)), get_global_id(UInt32(1)), get_global_id(UInt32(2))
# )
SPIRVIntrinsics.@printf(

Check warning on line 13 in src/pocl/device/runtime.jl

Codecov / codecov/patch

src/pocl/device/runtime.jl#L13

Added line #L13 was not covered by tests
"ERROR: a %s was thrown during kernel execution on thread (%d, %d, %d).\n",
ex, get_global_id(UInt32(0)), get_global_id(UInt32(1)), get_global_id(UInt32(2))
)
return
end

function report_exception_name(ex)
# SPIRVIntrinsics.@printf(
# "ERROR: a %s was thrown during kernel execution on thread (%d, %d, %d).\n",
# ex, get_global_id(UInt32(0)), get_global_id(UInt32(1)), get_global_id(UInt32(2))
# )
# SPIRVIntrinsics.@printf("Stacktrace:\n")
SPIRVIntrinsics.@printf(

Check warning on line 21 in src/pocl/device/runtime.jl

Codecov / codecov/patch

src/pocl/device/runtime.jl#L21

Added line #L21 was not covered by tests
"ERROR: a %s was thrown during kernel execution on thread (%d, %d, %d).\n",
ex, get_global_id(UInt32(0)), get_global_id(UInt32(1)), get_global_id(UInt32(2))
)
SPIRVIntrinsics.@printf("Stacktrace:\n")

Check warning on line 25 in src/pocl/device/runtime.jl

Codecov / codecov/patch

src/pocl/device/runtime.jl#L25

Added line #L25 was not covered by tests
return
end

function report_exception_frame(idx, func, file, line)
# SPIRVIntrinsics.@printf(" [%d] %s at %s:%d\n", idx, func, file, line)
SPIRVIntrinsics.@printf(" [%d] %s at %s:%d\n", idx, func, file, line)

Check warning on line 30 in src/pocl/device/runtime.jl

Codecov / codecov/patch

src/pocl/device/runtime.jl#L30

Added line #L30 was not covered by tests
return
end