diff --git a/CHANGELOG b/CHANGELOG index 96912de..21b9219 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ ## Unreleased +- Fix order of BO arguments in BOArray constructor which lead to allocation errors - Convert prepare_bitstream function to macro and fix signature generation - Minor changes in method names (adding ! to some methods because they change their input parameters) - Move wrapped API to XRTWrap submodule to support easier extension of core functionality diff --git a/src/xrt_bo.jl b/src/xrt_bo.jl index 73c0935..f9438a3 100644 --- a/src/xrt_bo.jl +++ b/src/xrt_bo.jl @@ -79,7 +79,7 @@ function BOArray(device::Device, userdata::AbstractArray{T,N}, mem; flags::XRTWr else aligned_buffer = userdata end - bo = BO(device, Base.unsafe_convert(Ptr{Nothing}, aligned_buffer), length(aligned_buffer) * sizeof(eltype(aligned_buffer)), mem, flags) + bo = BO(device, Base.unsafe_convert(Ptr{Nothing}, aligned_buffer), sizeof(aligned_buffer), flags, mem) BOArray(bo, aligned_buffer) end @@ -91,7 +91,7 @@ alignment of host buffers. """ function BOArray{T,N}(device::Device, size, mem; flags::XRTWrap.BOFlags=XRTWrap.XRT_BO_FLAGS_NORMAL) where {T,N} aligned_buffer = Array{T,N}(MemAlign(4096), size) - bo = BO(device, Base.unsafe_convert(Ptr{Nothing}, aligned_buffer), length(aligned_buffer) * sizeof(eltype(aligned_buffer)), mem, flags) + bo = BO(device, Base.unsafe_convert(Ptr{Nothing}, aligned_buffer), length(aligned_buffer) * sizeof(eltype(aligned_buffer)), flags, mem) BOArray(bo, aligned_buffer) end