Skip to content
Open
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
8 changes: 6 additions & 2 deletions matlab.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,15 @@ mxArray* wrap<bool>(const bool& value) {
return result;
}

// specialization to size_t
// specialization to size_t but skip Win64 size check & CUDACC check
#if !defined(_WIN64) || defined(__CUDACC__)
template<>
mxArray* wrap<size_t>(const size_t& value) {
mxArray *result = scalar(mxUINT32OR64_CLASS);
*(size_t*)mxGetData(result) = value;
return result;
}
#endif

// specialization to int
template<>
Expand Down Expand Up @@ -345,12 +347,14 @@ uint64_t unwrap<uint64_t>(const mxArray* array) {
return myGetScalar<uint64_t>(array);
}

// specialization to size_t
// specialization to size_t but skip Win64 size check (size_t == uint64_t) & CUDACC check
#if !defined(_WIN64) || defined(__CUDACC__)
template<>
size_t unwrap<size_t>(const mxArray* array) {
checkScalar(array, "unwrap<size_t>");
return myGetScalar<size_t>(array);
}
#endif

// specialization to double
template<>
Expand Down
Loading