Skip to content

Commit 10a7381

Browse files
authored
Added missing support for MemoryBank::unspecified to new API
1 parent 44ba0d6 commit 10a7381

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

include/hlslib/common/OpenCL.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,12 @@ MemoryBank StorageTypeToMemoryBank(StorageType storage, int bank) {
259259
if (storage != StorageType::DDR) {
260260
ThrowRuntimeError("Only DDR bank identifiers can be converted to memory bank flags.");
261261
}
262-
if (bank < 0 || bank > 3) {
263-
ThrowRuntimeError("Bank identifier is out of range (must be [0-3]).");
262+
if (bank < -1 || bank > 3) {
263+
ThrowRuntimeError("Bank identifier is out of range (must be [0-3] or -1 for unspecified).");
264264
}
265265
switch (bank) {
266+
case -1:
267+
return MemoryBank::unspecified;
266268
case 0:
267269
return MemoryBank::bank0;
268270
case 1:

intel_test/host/RunJacobi2D.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ int main(int argc, char **argv) {
9696
std::copy(host_buffer.begin(), host_buffer.end(),
9797
copy_host_buffer.begin() + kW * kH);
9898
device_buffer = context.MakeBuffer<Data_t, hlslib::ocl::Access::readWrite>(
99-
hlslib::ocl::StorageType::DDR, 1, copy_host_buffer.begin(),
99+
hlslib::ocl::StorageType::DDR, -1, copy_host_buffer.begin(),
100100
copy_host_buffer.end());
101101
} else if (copyMode == "newapi_notransfer") {
102102
device_buffer = context.MakeBuffer<Data_t, hlslib::ocl::Access::readWrite>(

0 commit comments

Comments
 (0)