Blender V5.0
util_float8_test.h File Reference
#include <gtest/gtest.h>
#include "util/math.h"
#include "util/system.h"
#include "util/types.h"

Go to the source code of this file.

Macros

#define INIT_FLOAT8_TEST
#define compare_vector_scalar(a, b)
#define compare_vector_vector(a, b)
#define compare_vector_vector_near(a, b, abserror)
#define basic_test_vv(a, b, op)
#define basic_test_vf(a, b, op)

Functions

static CCL_NAMESPACE_BEGIN bool validate_cpu_capabilities ()
static vfloat8 float8_a ()
static vfloat8 float8_b ()
static vfloat8 float8_c ()
 TEST (TEST_CATEGORY_NAME, float8_add_vv)
 TEST (TEST_CATEGORY_NAME, float8_sub_vv)
 TEST (TEST_CATEGORY_NAME, float8_mul_vv)
 TEST (TEST_CATEGORY_NAME, float8_div_vv)
 TEST (TEST_CATEGORY_NAME, float8_add_vf)
 TEST (TEST_CATEGORY_NAME, float8_sub_vf)
 TEST (TEST_CATEGORY_NAME, float8_mul_vf)
 TEST (TEST_CATEGORY_NAME, float8_div_vf)
 TEST (TEST_CATEGORY_NAME, float8_ctor)
 TEST (TEST_CATEGORY_NAME, float8_sqrt)
 TEST (TEST_CATEGORY_NAME, float8_min_max)
 TEST (TEST_CATEGORY_NAME, float8_shuffle)

Variables

static const float float_b = 1.5f

Macro Definition Documentation

◆ basic_test_vf

#define basic_test_vf ( a,
b,
op )
Value:
INIT_FLOAT8_TEST \
vfloat8 c = a op b; \
for (size_t i = 0; i < 8; i++) \
EXPECT_FLOAT_EQ(c[i], a[i] op b);
i
Definition text_draw.cc:230

Definition at line 67 of file util_float8_test.h.

◆ basic_test_vv

#define basic_test_vv ( a,
b,
op )
Value:
INIT_FLOAT8_TEST \
vfloat8 c = a op b; \
for (size_t i = 0; i < 8; i++) \
EXPECT_FLOAT_EQ(c[i], a[i] op b[i]);

Definition at line 60 of file util_float8_test.h.

◆ compare_vector_scalar

#define compare_vector_scalar ( a,
b )
Value:
for (size_t index = 0; index < 8; index++) \
EXPECT_FLOAT_EQ(a[index], b);

Definition at line 48 of file util_float8_test.h.

Referenced by TEST().

◆ compare_vector_vector

#define compare_vector_vector ( a,
b )
Value:
for (size_t index = 0; index < 8; index++) \
EXPECT_FLOAT_EQ(a[index], b[index]);

Definition at line 52 of file util_float8_test.h.

Referenced by TEST(), TEST(), and TEST().

◆ compare_vector_vector_near

#define compare_vector_vector_near ( a,
b,
abserror )
Value:
for (size_t index = 0; index < 8; index++) \
EXPECT_NEAR(a[index], b[index], abserror);

Definition at line 56 of file util_float8_test.h.

◆ INIT_FLOAT8_TEST

#define INIT_FLOAT8_TEST
Value:
return;
static CCL_NAMESPACE_BEGIN bool validate_cpu_capabilities()

Definition at line 44 of file util_float8_test.h.

Referenced by TEST(), TEST(), TEST(), and TEST().

Function Documentation

◆ float8_a()

vfloat8 float8_a ( )
static

Definition at line 29 of file util_float8_test.h.

References make_vfloat8().

Referenced by TEST(), and TEST().

◆ float8_b()

vfloat8 float8_b ( )
static

Definition at line 34 of file util_float8_test.h.

References make_vfloat8().

Referenced by TEST(), and TEST().

◆ float8_c()

vfloat8 float8_c ( )
static

Definition at line 39 of file util_float8_test.h.

References make_vfloat8().

◆ TEST() [1/12]

TEST ( TEST_CATEGORY_NAME ,
float8_add_vf  )

Definition at line 79 of file util_float8_test.h.

◆ TEST() [2/12]

TEST ( TEST_CATEGORY_NAME ,
float8_add_vv  )

Definition at line 75 of file util_float8_test.h.

References TEST_CATEGORY_NAME.

◆ TEST() [3/12]

TEST ( TEST_CATEGORY_NAME ,
float8_ctor  )

◆ TEST() [4/12]

TEST ( TEST_CATEGORY_NAME ,
float8_div_vf  )

Definition at line 82 of file util_float8_test.h.

References float_b.

◆ TEST() [5/12]

TEST ( TEST_CATEGORY_NAME ,
float8_div_vv  )

Definition at line 78 of file util_float8_test.h.

◆ TEST() [6/12]

TEST ( TEST_CATEGORY_NAME ,
float8_min_max  )

◆ TEST() [7/12]

TEST ( TEST_CATEGORY_NAME ,
float8_mul_vf  )

Definition at line 81 of file util_float8_test.h.

References float_b.

◆ TEST() [8/12]

TEST ( TEST_CATEGORY_NAME ,
float8_mul_vv  )

Definition at line 77 of file util_float8_test.h.

◆ TEST() [9/12]

TEST ( TEST_CATEGORY_NAME ,
float8_shuffle  )

◆ TEST() [10/12]

TEST ( TEST_CATEGORY_NAME ,
float8_sqrt  )

◆ TEST() [11/12]

TEST ( TEST_CATEGORY_NAME ,
float8_sub_vf  )

Definition at line 80 of file util_float8_test.h.

References float_b.

◆ TEST() [12/12]

TEST ( TEST_CATEGORY_NAME ,
float8_sub_vv  )

Definition at line 76 of file util_float8_test.h.

◆ validate_cpu_capabilities()

CCL_NAMESPACE_BEGIN bool validate_cpu_capabilities ( )
static

Definition at line 13 of file util_float8_test.h.

References system_cpu_support_avx2(), and system_cpu_support_sse42().

Variable Documentation

◆ float_b

const float float_b = 1.5f
static

Definition at line 73 of file util_float8_test.h.

Referenced by TEST(), TEST(), and TEST().