Repository navigation
Accept callable objects as kernels - #1198
Conversation
Remove `hipfunction`'s `Function` constraint so callable objects (structs with call methods) can be launched as kernels without a `MethodError`. JuliaGPU/KernelAbstractions.jl#931 uses such kernels. Nothing depends on the constraint, and CUDA.jl's `cufunction` has none.
|
cscs-ci run MI250,MI300 |
Benchmark resultsCompared with 3e7016582, the merge base. Times are the minimum time of every benchmark. A change is unusual when it exceeds both three times the benchmark's typical change between consecutive runs on the default branch and a minimum per category (performance 3%, latency 5%, applications 3%, other 3%). A benchmark that starts or stops allocating is listed however few the allocations. A single run can still be a fluke, so rerun before drawing conclusions.
All benchmarks
|
Remove
hipfunction'sFunctionconstraint so callable objects (structs with call methods) can be launched as kernels. Previously, this failed with aMethodError:JuliaGPU/KernelAbstractions.jl#931 launches a callable object in its "partition for the kernel function" test, which fails on AMDGPU. Nothing depends on the constraint, and CUDA.jl's
cufunctionhas none.@rocconverts callable objects like closures, passing their fields as the kernel's first argument. Compiled kernels are cached by type; the added test checks that a new instance reuses the kernel with its own state.Tests:
device/launch(fails without the change, passes with it);kernelabstractions_tests,kernelinterface_testsanddevice/launchagainst KernelAbstractions#931 (a2dd21b3) on gfx1036.