Skip to content
Merged
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
4 changes: 4 additions & 0 deletions src/api/c/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,12 @@ void write_array(af_array arr, const T *const data, const size_t bytes,

af_err af_write_array(af_array arr, const void *data, const size_t bytes,
af_source src) {
if (bytes == 0) { return AF_SUCCESS; }
try {
af_dtype type = getInfo(arr).getType();
ARG_ASSERT(1, (data != nullptr));
ARG_ASSERT(3, (src == afHost || src == afDevice));
// FIXME ArrayInfo class no bytes method, hence commented
// DIM_ASSERT(2, bytes <= getInfo(arr).bytes());

switch (type) {
Expand Down