Skip to content

Commit

Permalink
[ESIMD] Fix obsolete TODO comments + enable more cases in ballot.cpp (#…
Browse files Browse the repository at this point in the history
…12657)

Signed-off-by: Klochkov, Vyacheslav N <vyacheslav.n.klochkov@intel.com>
  • Loading branch information
v-klochkov authored Feb 8, 2024
1 parent 7ee7e90 commit 3405149
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
12 changes: 5 additions & 7 deletions sycl/test-e2e/ESIMD/api/ballot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,13 @@ template <class T, int N> bool test(queue &Q) {
template <class T> bool test(queue &Q) {
bool Pass = true;

// TODO: uncomment calls below once simd<...>.copy_from() starts supporting
// sizes other than 8, 16 and 32.
// Pass &= test<T, 4>(Q);
Pass &= test<T, 4>(Q);
Pass &= test<T, 8>(Q);
// Pass &= test<T, 12>(Q);
Pass &= test<T, 12>(Q);
Pass &= test<T, 16>(Q);
// Pass &= test<T, 20>(Q);
// Pass &= test<T, 24>(Q);
// Pass &= test<T, 28>(Q);
Pass &= test<T, 20>(Q);
Pass &= test<T, 24>(Q);
Pass &= test<T, 28>(Q);
Pass &= test<T, 32>(Q);

return Pass;
Expand Down
5 changes: 1 addition & 4 deletions sycl/test-e2e/ESIMD/dpas/dpas_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ template <dpas_argument_type T> struct DpasNaturalOperandType {
static constexpr bool is_bf16 = T == dpas_argument_type::bf16;
static constexpr bool is_tf32 = T == dpas_argument_type::tf32;

// TODO: support tf32 here.
using type = std::conditional_t<
is_sint, signed char,
std::conditional_t<
Expand Down Expand Up @@ -149,7 +148,7 @@ void writeToHorizontallyPackedMatrix(void *VVec, int Row, int Col,
ElemT *Vec = reinterpret_cast<ElemT *>(VVec);

// 1. Find and read the target 'unsigned int' element.
// THe unpacked matrix has dimensions: NumRows*NumCols
// The unpacked matrix dimensions are NumRows*NumCols.
constexpr int ElemsInElemT = sizeof(ElemT) * 8 / ElemBitSize;
int UnpackedLinearIndex = Row * NumCols + Col;
int PackedLinearIndex = UnpackedLinearIndex / ElemsInElemT;
Expand All @@ -160,7 +159,6 @@ void writeToHorizontallyPackedMatrix(void *VVec, int Row, int Col,
} else {
ElemT TargetElem = Vec[PackedLinearIndex];
// TargetElem has 2 or more elements in it. Need to extract one.
// TODO: for now assume that is the case only for 2 or 4-bit integers.
assert((ElemBitSize == 2 || ElemBitSize == 4) && "Unexpected element type");

unsigned int Offset = (UnpackedLinearIndex % ElemsInElemT) * ElemBitSize;
Expand Down Expand Up @@ -196,7 +194,6 @@ ReadT readFromHorizontallyPackedMatrix(void *VVec, int Row, int Col) {
return static_cast<ReadT>(TargetElem);
} else {
// TargetElem has 2 or more elements in it. Need to extract one.
// TODO: for now assume that is the case only for 2 or 4-bit integers.
assert((ElemBitSize == 2 || ElemBitSize == 4) && "Unexpected element type");
unsigned int Offset = (UnpackedLinearIndex % ElemsInElemT) * ElemBitSize;
unsigned int Mask = (static_cast<uint64_t>(1) << ElemBitSize) - 1;
Expand Down

0 comments on commit 3405149

Please sign in to comment.