Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

SIMD unittests [WIP] #29

Draft
wants to merge 38 commits into
base: master
Choose a base branch
from

Conversation

JacobDomagala
Copy link

@JacobDomagala JacobDomagala commented Aug 17, 2021

Related to NexGenAnalytics#1

TODO:

  • Add gtest
  • Create src/test directories and add CMake support
  • Add tests

@fnrizzi
Copy link

fnrizzi commented Sep 20, 2021

Unit tests need to work on:

  • cover all public functionality of the SIMD classes and its child classes.
  • X86 CPUs
  • ARM CPUs
  • IBM Power CPUs
  • NVIDIA GPUs


// Methods to create data
template<class ValueType>
Kokkos::View<simd_t<ValueType> *> create_data_with_uniq_value(std::string name, int size, ValueType value) {
Copy link

Choose a reason for hiding this comment

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

I would change a bit the names here to be more explicit about what we are creating, something like:

create_view_with_unique_value

}

template<class ValueType>
Kokkos::View<simd_t<ValueType> *> create_data_zero_to_size_positive(std::string name, int size, SIMD_CONSTRUCTOR constructor = SIMD_CONSTRUCTOR_SCALAR) {
Copy link

Choose a reason for hiding this comment

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

improve name because If I read this, I would not get what "positive" means

}

template<class ValueType>
Kokkos::View<simd_t<ValueType> *> create_data_zero_to_size_negative(std::string name, int size, SIMD_CONSTRUCTOR constructor = SIMD_CONSTRUCTOR_SCALAR) {
Copy link

Choose a reason for hiding this comment

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

similarly to positive

}

template<class ValueType>
Kokkos::View<simd_t<ValueType> *> create_data_sqrt(std::string name, int size, SIMD_CONSTRUCTOR constructor = SIMD_CONSTRUCTOR_SCALAR) {
Copy link

@fnrizzi fnrizzi Sep 20, 2021

Choose a reason for hiding this comment

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

"create_data_sqrt" what does this mean? if this a helper function needed to test the sqrt, then we could use:

create_view_for_sqrt_test

otherwise, if we chose a more general name, the name should express how you fill it

}

template<class ValueType>
Kokkos::View<simd_t<ValueType> *> create_data_cbrt(std::string name, int size, SIMD_CONSTRUCTOR constructor = SIMD_CONSTRUCTOR_SCALAR) {
Copy link

Choose a reason for hiding this comment

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

same comment as the sqrt

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