Skip to content

Commit

Permalink
Added missing support for MemoryBank::unspecified to new API
Browse files Browse the repository at this point in the history
  • Loading branch information
jnice-81 authored Jul 1, 2021
1 parent 44ba0d6 commit 10a7381
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions include/hlslib/common/OpenCL.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,12 @@ MemoryBank StorageTypeToMemoryBank(StorageType storage, int bank) {
if (storage != StorageType::DDR) {
ThrowRuntimeError("Only DDR bank identifiers can be converted to memory bank flags.");
}
if (bank < 0 || bank > 3) {
ThrowRuntimeError("Bank identifier is out of range (must be [0-3]).");
if (bank < -1 || bank > 3) {
ThrowRuntimeError("Bank identifier is out of range (must be [0-3] or -1 for unspecified).");
}
switch (bank) {
case -1:
return MemoryBank::unspecified;
case 0:
return MemoryBank::bank0;
case 1:
Expand Down
2 changes: 1 addition & 1 deletion intel_test/host/RunJacobi2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ int main(int argc, char **argv) {
std::copy(host_buffer.begin(), host_buffer.end(),
copy_host_buffer.begin() + kW * kH);
device_buffer = context.MakeBuffer<Data_t, hlslib::ocl::Access::readWrite>(
hlslib::ocl::StorageType::DDR, 1, copy_host_buffer.begin(),
hlslib::ocl::StorageType::DDR, -1, copy_host_buffer.begin(),
copy_host_buffer.end());
} else if (copyMode == "newapi_notransfer") {
device_buffer = context.MakeBuffer<Data_t, hlslib::ocl::Access::readWrite>(
Expand Down

0 comments on commit 10a7381

Please sign in to comment.