Merge branch 'origin/pghafari/vdi-prototype' into lmoriche/amd-master

Change-Id: Id3b833d405596735becb3346f3b08c6da57033fe
此提交包含在:
Laurent Morichetti
2020-01-28 22:56:27 -08:00
父節點 914c2eb8b6
當前提交 20c7173849
共有 356 個檔案被更改,包括 3337 行新增 和 14228 行删除
+52
查看文件
@@ -0,0 +1,52 @@
//
// Copyright (c) 2008 Advanced Micro Devices, Inc. All rights reserved.
//
#include "platform/ndrange.hpp"
namespace amd {
NDRange::NDRange(size_t dimensions) : dimensions_(dimensions) { *this = 0; }
NDRange::NDRange(const NDRange& space) : dimensions_(space.dimensions_) { *this = space; }
NDRange& NDRange::operator=(size_t x) {
for (size_t i = 0; i < dimensions_; ++i) {
data_[i] = x;
}
return *this;
}
NDRange::~NDRange() {}
bool NDRange::operator==(const NDRange& x) const {
assert(dimensions_ == x.dimensions_ && "dimensions mismatch");
for (size_t i = 0; i < dimensions_; ++i) {
if (data_[i] != x.data_[i]) {
return false;
}
}
return true;
}
bool NDRange::operator==(size_t x) const {
for (size_t i = 0; i < dimensions_; ++i) {
if (data_[i] != x) {
return false;
}
}
return true;
}
#ifdef DEBUG
void NDRange::printOn(FILE* file) const {
fprintf(file, "[");
for (size_t i = dimensions_ - 1; i > 0; --i) {
fprintf(file, SIZE_T_FMT ", ", data_[i]);
}
fprintf(file, SIZE_T_FMT "]", data_[0]);
}
#endif // DEBUG
} // namespace amd