Skip to content

[WIP][SYCL][ESIMD] Replace mask_type_t with simd_mask to represent Gen predicates. #3787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

kbobrovs
Copy link
Contributor

@kbobrovs kbobrovs commented May 20, 2021

This patch introduces simd_mask class which represents a Gen simd operation mask.
Aims to have similar interface to std::experimantal::simd_mask:
(https://github.com/llvm/llvm-project/blob/main/libcxx/include/experimental/simd)
Compared to std::experimantal::simd_mask, this implementation

  • does not provide the following members/features:
    • abi_type (not needed for ESIMD)
    • simd_type (not needed for ESIMD)
    • reference (TODO)
    • implicit type conversion constructor (not needed for ESIMD)
    • reference operator (TODO)
    • flags in memory load/store operations (TODO)
    • reduction functions (TODO):
      any_of, all_of, some_of, none_of, popcount, find_first_set, find_last_set
  • additionally provides some extra features, like
    • broadcast constructor for any integer type
    • implicit conversion from the simd class
    • constructor from fixed-size array
    • ... few more

TODO (WIP): select and iupdate operations

This patch addresses this review comment:
// TODO @rolandschulz on May 21
// {quote}
// - The mask should also be a wrapper around the clang - vector type rather
// than the clang - vector type itself.
// - The internal storage should be implementation defined.uint16_t is a bad
// choice for some HW.Nor is it how clang - vector types works(using the same
// size int as the corresponding vector type used for comparison(e.g. long for
// double and int for float)).

E2E test: intel/llvm-test-suite#286

Signed-off-by: kbobrovs [email protected]

…dicates.

Represents a Gen simd operation mask. Aims to have similar interface to
std::experimantal::simd_mask:
(https://github.com/llvm/llvm-project/blob/main/libcxx/include/experimental/simd)
Compared to std::experimantal::simd_mask, this implementation
* does not provide the following members/features:
  - abi_type (not needed for ESIMD)
  - simd_type (not needed for ESIMD)
  - reference (TODO)
  - implicit type conversion constructor (not needed for ESIMD)
  - reference operator[](size_t) (TODO)
  - flags in memory load/store operations (TODO)
  - reduction functions (TODO):
      any_of, all_of, some_of, none_of, popcount, find_first_set, find_last_set
* additionally provides some extra features, like
  - broadcast constructor for any integer type
  - implicit conversion from the simd class
  - constructor from fixed-size array
  - ... few more

Signed-off-by: kbobrovs <[email protected]>
@kychendev
Copy link
Contributor

  • The patch doesn’t cover esimd pack_mask/unpack_mask yet, which are useful mask operations. Please update it as well.
  • There is no support for mask select operation. This will be inconvenient for ESIMD programmers.
  • Please make similar changes to REL operators defined in esimd_view.hpp to handle masks generated from comparison operation of simd_view objects.

@kbobrovs kbobrovs closed this Aug 3, 2021
@kbobrovs
Copy link
Contributor Author

kbobrovs commented Aug 3, 2021

Replaced with #4230

@kbobrovs kbobrovs deleted the esimd_api_fix_mask branch October 4, 2021 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants