Skip to content

Commit 65de48c

Browse files
committed
Fix oneMKL sparse CSR bindings for the LTS stack
1 parent b1cef36 commit 65de48c

3 files changed

Lines changed: 32 additions & 30 deletions

File tree

lib/mkl/wrappers_sparse.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ for (fname, elty, intty) in ((:onemklSsparse_set_csr_data , :Float32 , :Int3
6060
queue = global_queue(context(nzVal), device(nzVal))
6161
# Don't update handle if matrix is empty
6262
if m != 0 && n != 0
63-
$fname(sycl_queue(queue), handle_ptr[], m, n, 'O', rowPtr, colVal, nzVal)
63+
$fname(sycl_queue(queue), handle_ptr[], m, n, nnzA, 'O', rowPtr, colVal, nzVal)
6464
dA = oneSparseMatrixCSR{$elty, $intty}(handle_ptr[], rowPtr, colVal, nzVal, (m, n), nnzA)
6565
finalizer(sparse_release_matrix_handle, dA)
6666
else
@@ -81,7 +81,7 @@ for (fname, elty, intty) in ((:onemklSsparse_set_csr_data , :Float32 , :Int3
8181
nnzA = length(nzVal)
8282
# Don't update handle if matrix is empty
8383
if m != 0 && n != 0
84-
$fname(sycl_queue(queue), handle_ptr[], n, m, 'O', colPtr, rowVal, nzVal) # CSC of A is CSR of Aᵀ
84+
$fname(sycl_queue(queue), handle_ptr[], n, m, nnzA, 'O', colPtr, rowVal, nzVal) # CSC of A is CSR of Aᵀ
8585
dA = oneSparseMatrixCSC{$elty, $intty}(handle_ptr[], colPtr, rowVal, nzVal, (m, n), nnzA)
8686
finalizer(sparse_release_matrix_handle, dA)
8787
else

lib/support/liboneapi_support.jl

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6442,87 +6442,87 @@ function onemklSsparse_set_csr_data(device_queue, spmat, nrows, ncols, nnz, inde
64426442
@ccall liboneapi_support.onemklSsparse_set_csr_data(device_queue::syclQueue_t,
64436443
spmat::matrix_handle_t,
64446444
nrows::Int64, ncols::Int64,
6445-
nnz::Int64, index::ZePtr{Int32},
6445+
nnz::Int64, index::onemklIndex,
64466446
row_ptr::ZePtr{Int32},
6447-
col_ind::ZePtr{Cfloat},
6448-
values::Ptr{Cfloat})::Cint
6447+
col_ind::ZePtr{Int32},
6448+
values::ZePtr{Cfloat})::Cint
64496449
end
64506450

64516451
function onemklSsparse_set_csr_data_64(device_queue, spmat, nrows, ncols, nnz, index,
64526452
row_ptr, col_ind, values)
64536453
@ccall liboneapi_support.onemklSsparse_set_csr_data_64(device_queue::syclQueue_t,
64546454
spmat::matrix_handle_t,
64556455
nrows::Int64, ncols::Int64,
6456-
nnz::Int64, index::ZePtr{Int64},
6456+
nnz::Int64, index::onemklIndex,
64576457
row_ptr::ZePtr{Int64},
6458-
col_ind::ZePtr{Cfloat},
6459-
values::Ptr{Cfloat})::Cint
6458+
col_ind::ZePtr{Int64},
6459+
values::ZePtr{Cfloat})::Cint
64606460
end
64616461

64626462
function onemklDsparse_set_csr_data(device_queue, spmat, nrows, ncols, nnz, index, row_ptr,
64636463
col_ind, values)
64646464
@ccall liboneapi_support.onemklDsparse_set_csr_data(device_queue::syclQueue_t,
64656465
spmat::matrix_handle_t,
64666466
nrows::Int64, ncols::Int64,
6467-
nnz::Int64, index::ZePtr{Int32},
6467+
nnz::Int64, index::onemklIndex,
64686468
row_ptr::ZePtr{Int32},
6469-
col_ind::ZePtr{Cdouble},
6470-
values::Ptr{Cdouble})::Cint
6469+
col_ind::ZePtr{Int32},
6470+
values::ZePtr{Cdouble})::Cint
64716471
end
64726472

64736473
function onemklDsparse_set_csr_data_64(device_queue, spmat, nrows, ncols, nnz, index,
64746474
row_ptr, col_ind, values)
64756475
@ccall liboneapi_support.onemklDsparse_set_csr_data_64(device_queue::syclQueue_t,
64766476
spmat::matrix_handle_t,
64776477
nrows::Int64, ncols::Int64,
6478-
nnz::Int64, index::ZePtr{Int64},
6478+
nnz::Int64, index::onemklIndex,
64796479
row_ptr::ZePtr{Int64},
6480-
col_ind::ZePtr{Cdouble},
6481-
values::Ptr{Cdouble})::Cint
6480+
col_ind::ZePtr{Int64},
6481+
values::ZePtr{Cdouble})::Cint
64826482
end
64836483

64846484
function onemklCsparse_set_csr_data(device_queue, spmat, nrows, ncols, nnz, index, row_ptr,
64856485
col_ind, values)
64866486
@ccall liboneapi_support.onemklCsparse_set_csr_data(device_queue::syclQueue_t,
64876487
spmat::matrix_handle_t,
64886488
nrows::Int64, ncols::Int64,
6489-
nnz::Int64, index::ZePtr{Int32},
6489+
nnz::Int64, index::onemklIndex,
64906490
row_ptr::ZePtr{Int32},
6491-
col_ind::ZePtr{ComplexF32},
6492-
values::Ptr{ComplexF32})::Cint
6491+
col_ind::ZePtr{Int32},
6492+
values::ZePtr{ComplexF32})::Cint
64936493
end
64946494

64956495
function onemklCsparse_set_csr_data_64(device_queue, spmat, nrows, ncols, nnz, index,
64966496
row_ptr, col_ind, values)
64976497
@ccall liboneapi_support.onemklCsparse_set_csr_data_64(device_queue::syclQueue_t,
64986498
spmat::matrix_handle_t,
64996499
nrows::Int64, ncols::Int64,
6500-
nnz::Int64, index::ZePtr{Int64},
6500+
nnz::Int64, index::onemklIndex,
65016501
row_ptr::ZePtr{Int64},
6502-
col_ind::ZePtr{ComplexF32},
6503-
values::Ptr{ComplexF32})::Cint
6502+
col_ind::ZePtr{Int64},
6503+
values::ZePtr{ComplexF32})::Cint
65046504
end
65056505

65066506
function onemklZsparse_set_csr_data(device_queue, spmat, nrows, ncols, nnz, index, row_ptr,
65076507
col_ind, values)
65086508
@ccall liboneapi_support.onemklZsparse_set_csr_data(device_queue::syclQueue_t,
65096509
spmat::matrix_handle_t,
65106510
nrows::Int64, ncols::Int64,
6511-
nnz::Int64, index::ZePtr{Int32},
6511+
nnz::Int64, index::onemklIndex,
65126512
row_ptr::ZePtr{Int32},
6513-
col_ind::ZePtr{ComplexF64},
6514-
values::Ptr{ComplexF32})::Cint
6513+
col_ind::ZePtr{Int32},
6514+
values::ZePtr{ComplexF64})::Cint
65156515
end
65166516

65176517
function onemklZsparse_set_csr_data_64(device_queue, spmat, nrows, ncols, nnz, index,
65186518
row_ptr, col_ind, values)
65196519
@ccall liboneapi_support.onemklZsparse_set_csr_data_64(device_queue::syclQueue_t,
65206520
spmat::matrix_handle_t,
65216521
nrows::Int64, ncols::Int64,
6522-
nnz::Int64, index::ZePtr{Int64},
6522+
nnz::Int64, index::onemklIndex,
65236523
row_ptr::ZePtr{Int64},
6524-
col_ind::ZePtr{ComplexF64},
6525-
values::Ptr{ComplexF32})::Cint
6524+
col_ind::ZePtr{Int64},
6525+
values::ZePtr{ComplexF64})::Cint
65266526
end
65276527

65286528
function onemklSsparse_set_csc_data(device_queue, spMat, nrows, ncols, nnz, index, col_ptr,

res/support.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,15 +370,17 @@ use_ccall_macro = true
370370
6 = "ZePtr{Float32}"
371371
8 = "Ref{Float32}"
372372

373+
# Argument positions account for the `nnz` parameter (arg 5) and the
374+
# `index::onemklIndex` enum (arg 6); the device pointers are args 7-9.
373375
[api.onemklXsparse_set_csr_data.argtypes]
374-
6 = "ZePtr{Int32}"
375376
7 = "ZePtr{Int32}"
376-
8 = "ZePtr{T}"
377+
8 = "ZePtr{Int32}"
378+
9 = "ZePtr{T}"
377379

378380
[api.onemklXsparse_set_csr_data_64.argtypes]
379-
6 = "ZePtr{Int64}"
380381
7 = "ZePtr{Int64}"
381-
8 = "ZePtr{T}"
382+
8 = "ZePtr{Int64}"
383+
9 = "ZePtr{T}"
382384

383385
[api.onemklXsparse_set_coo_data.argtypes]
384386
7 = "ZePtr{Int32}"

0 commit comments

Comments
 (0)