Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL][ESIMD] Add test for esimd copy constructor #578

Merged
merged 34 commits into from
Dec 10, 2021

Conversation

vasilytric
Copy link

@vasilytric vasilytric commented Nov 22, 2021

This PR provides test for simd copy constructor.
The test verifies that simd's elements value is equal to values from reference data

Also was added common.hpp file that provide functions for constructing reference data and function for calling simd in a predefined context


This PR depend on PR #565
In PR#565 can be found these files can be found in this :

  • logger.hpp
  • type_coverage.hpp

This file provides functional that let obtain reference data and common
function for constructing simd object, that return's output data that
should be compared with reference data
vasilytric and others added 17 commits November 24, 2021 13:56
This file will be useful for another tests on simd
For this test required init fp variables by bit statements and comparing
fp variables by bitwise comparison.

Co-Authored-By: Kochetkov, Yuriy <[email protected]>
- returning values without assignment it to variable
- returning vector with ref data instead of interacting with vector,
  that obtained by reference
- replacing if else block by if block because we doesn't provide some
  "else" block
- remove duplicated values for init ref values in vector
- rename "it" to "i" in sycles due to it's more logical
Update comments in the following files:
- SYCL/ESIMD/api/functional/common.hpp
- SYCL/ESIMD/api/functional/ctors/ctor_copy.cpp
- SYCL/ESIMD/api/functional/value.hpp
Previous function and return value assignment was in a different lines,
now they containings in the one line.
It would be better to switch to the SYCL-2020 headers
Renamed to shared_vector and shared_allocator.
This names is better than privious names.
To enforce const-correctness for the reference data
By doing so we make it explicit for the fellow programmers that
the function is not a part of the public API.
It protect newly programmers for some unexpected errors
This function return zero for signed and unsigned datatypes, so this
function will be called only for floating poin datatypes.
This allows avoid using variables for expression like "max - 1"
Copy link

@yuriykoch yuriykoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Vasily

- Uses do not need see some file-specific functions, so they moved into
"details" namespace
- Base clases was removed due to they could confuse new users
- Ctors specific functions were moved to ctors/common.hpp
- remove static_case and use static variables min_plus_one and
  max_minus_one due to this better solutions
- remove uniform initializations
- remove std::is_arithmetic_v due to by this condition can pass data
  types that shouldn't be passed to the generate_ref_data function
Due to the fact this name more self-descriebe
This let us comparing user-defined data types
Copy link

@yuriykoch yuriykoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Vasily) The code looks great.
Looks like it depends on PR #565 - please mark the dependency in description explicitly.

@vasilytric
Copy link
Author

Looks like it depends on PR #565 - please mark the dependency in description explicitly.

Thanks for the advice, done

- Unsigned variables will be compared by == operation all other types will
be compared bitwise
- Added comment that explaining need to use bitwise comparison
v-klochkov
v-klochkov previously approved these changes Dec 4, 2021
We requiring gpu and level_zero platforms due to the tests on simd
constructors doesn't supported OPenCL platform yet
I've got unexpected static assertion when calling simd::copy_from()
function. Was created issue in intel/llvm and this macros must be
enabled when it is resolved
The test disabled because of the fact the static_assert was retrieved
while calling simd::copy_from() function
@vasilytric
Copy link
Author

@v-klochkov The test for simd default constructor was merged into this PR, all checks are passed
Could you review new commits? If all is ok could you approve and merge it?

@v-klochkov v-klochkov merged commit f06b064 into intel:intel Dec 10, 2021
myler pushed a commit to myler/llvm-test-suite that referenced this pull request Apr 12, 2022
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants