Blender V4.3
util_float8_test.h File Reference
#include "testing/testing.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);
local_group_size(16, 16) .push_constant(Type b

Definition at line 66 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 59 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 47 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 51 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 55 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 43 of file util_float8_test.h.

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

Function Documentation

◆ float8_a()

static vfloat8 float8_a ( )
static

Definition at line 28 of file util_float8_test.h.

References make_vfloat8().

Referenced by TEST(), and TEST().

◆ float8_b()

static vfloat8 float8_b ( )
static

Definition at line 33 of file util_float8_test.h.

References make_vfloat8().

Referenced by TEST(), and TEST().

◆ float8_c()

static vfloat8 float8_c ( )
static

Definition at line 38 of file util_float8_test.h.

References make_vfloat8().

◆ TEST() [1/12]

TEST ( TEST_CATEGORY_NAME ,
float8_add_vf  )

Definition at line 78 of file util_float8_test.h.

◆ TEST() [2/12]

TEST ( TEST_CATEGORY_NAME ,
float8_add_vv  )

Definition at line 74 of file util_float8_test.h.

◆ TEST() [3/12]

TEST ( TEST_CATEGORY_NAME ,
float8_ctor  )

Definition at line 84 of file util_float8_test.h.

References compare_vector_scalar, INIT_FLOAT8_TEST, and make_vfloat8().

◆ TEST() [4/12]

TEST ( TEST_CATEGORY_NAME ,
float8_div_vf  )

Definition at line 81 of file util_float8_test.h.

◆ TEST() [5/12]

TEST ( TEST_CATEGORY_NAME ,
float8_div_vv  )

Definition at line 77 of file util_float8_test.h.

◆ TEST() [6/12]

TEST ( TEST_CATEGORY_NAME ,
float8_min_max  )

Definition at line 99 of file util_float8_test.h.

References compare_vector_vector, float8_a(), float8_b(), INIT_FLOAT8_TEST, max, and min.

◆ TEST() [7/12]

TEST ( TEST_CATEGORY_NAME ,
float8_mul_vf  )

Definition at line 80 of file util_float8_test.h.

◆ TEST() [8/12]

TEST ( TEST_CATEGORY_NAME ,
float8_mul_vv  )

Definition at line 76 of file util_float8_test.h.

◆ TEST() [9/12]

TEST ( TEST_CATEGORY_NAME ,
float8_shuffle  )

◆ TEST() [10/12]

TEST ( TEST_CATEGORY_NAME ,
float8_sqrt  )

Definition at line 92 of file util_float8_test.h.

References compare_vector_vector, INIT_FLOAT8_TEST, make_vfloat8(), and sqrt().

◆ TEST() [11/12]

TEST ( TEST_CATEGORY_NAME ,
float8_sub_vf  )

Definition at line 79 of file util_float8_test.h.

◆ TEST() [12/12]

TEST ( TEST_CATEGORY_NAME ,
float8_sub_vv  )

Definition at line 75 of file util_float8_test.h.

◆ validate_cpu_capabilities()

static CCL_NAMESPACE_BEGIN bool validate_cpu_capabilities ( )
static

Definition at line 12 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 72 of file util_float8_test.h.