diff --git a/include/spla/op.hpp b/include/spla/op.hpp index 9eaa15538..cfc85ab51 100644 --- a/include/spla/op.hpp +++ b/include/spla/op.hpp @@ -88,15 +88,12 @@ namespace spla { SPLA_API extern ref_ptr PLUS_INT; SPLA_API extern ref_ptr PLUS_UINT; SPLA_API extern ref_ptr PLUS_FLOAT; - SPLA_API extern ref_ptr MINUS_INT; SPLA_API extern ref_ptr MINUS_UINT; SPLA_API extern ref_ptr MINUS_FLOAT; - SPLA_API extern ref_ptr MULT_INT; SPLA_API extern ref_ptr MULT_UINT; SPLA_API extern ref_ptr MULT_FLOAT; - SPLA_API extern ref_ptr DIV_INT; SPLA_API extern ref_ptr DIV_UINT; SPLA_API extern ref_ptr DIV_FLOAT; @@ -104,7 +101,6 @@ namespace spla { SPLA_API extern ref_ptr FIRST_INT; SPLA_API extern ref_ptr FIRST_UINT; SPLA_API extern ref_ptr FIRST_FLOAT; - SPLA_API extern ref_ptr SECOND_INT; SPLA_API extern ref_ptr SECOND_UINT; SPLA_API extern ref_ptr SECOND_FLOAT; @@ -116,13 +112,16 @@ namespace spla { SPLA_API extern ref_ptr MIN_INT; SPLA_API extern ref_ptr MIN_UINT; SPLA_API extern ref_ptr MIN_FLOAT; - SPLA_API extern ref_ptr MAX_INT; SPLA_API extern ref_ptr MAX_UINT; SPLA_API extern ref_ptr MAX_FLOAT; - SPLA_API extern ref_ptr OR_INT; - SPLA_API extern ref_ptr OR_UINT; + SPLA_API extern ref_ptr BOR_INT; + SPLA_API extern ref_ptr BOR_UINT; + SPLA_API extern ref_ptr BAND_INT; + SPLA_API extern ref_ptr BAND_UINT; + SPLA_API extern ref_ptr BXOR_INT; + SPLA_API extern ref_ptr BXOR_UINT; SPLA_API extern ref_ptr GZERO_INT; SPLA_API extern ref_ptr GZERO_UINT; diff --git a/src/algorithm.cpp b/src/algorithm.cpp index b8739c992..080454eb8 100644 --- a/src/algorithm.cpp +++ b/src/algorithm.cpp @@ -59,7 +59,7 @@ namespace spla { depth->set_int(current_level); spla::execute_immediate(make_sched_v_assign_masked(v, frontier_prev, depth, SECOND_INT)); - spla::execute_immediate(make_sched_mxv_masked(frontier_new, v, A, frontier_prev, MULT_INT, OR_INT, zero, complement)); + spla::execute_immediate(make_sched_mxv_masked(frontier_new, v, A, frontier_prev, BAND_INT, BOR_INT, zero, complement)); spla::execute_immediate(make_sched_v_reduce(frontier_size, zero, frontier_new, PLUS_INT)); int observed_vertices; diff --git a/src/op.cpp b/src/op.cpp index 2c7209c0d..36f29e936 100644 --- a/src/op.cpp +++ b/src/op.cpp @@ -34,15 +34,12 @@ namespace spla { ref_ptr PLUS_INT; ref_ptr PLUS_UINT; ref_ptr PLUS_FLOAT; - ref_ptr MINUS_INT; ref_ptr MINUS_UINT; ref_ptr MINUS_FLOAT; - ref_ptr MULT_INT; ref_ptr MULT_UINT; ref_ptr MULT_FLOAT; - ref_ptr DIV_INT; ref_ptr DIV_UINT; ref_ptr DIV_FLOAT; @@ -50,7 +47,6 @@ namespace spla { ref_ptr FIRST_INT; ref_ptr FIRST_UINT; ref_ptr FIRST_FLOAT; - ref_ptr SECOND_INT; ref_ptr SECOND_UINT; ref_ptr SECOND_FLOAT; @@ -62,13 +58,16 @@ namespace spla { ref_ptr MIN_INT; ref_ptr MIN_UINT; ref_ptr MIN_FLOAT; - ref_ptr MAX_INT; ref_ptr MAX_UINT; ref_ptr MAX_FLOAT; - ref_ptr OR_INT; - ref_ptr OR_UINT; + ref_ptr BOR_INT; + ref_ptr BOR_UINT; + ref_ptr BAND_INT; + ref_ptr BAND_UINT; + ref_ptr BXOR_INT; + ref_ptr BXOR_UINT; ref_ptr GZERO_INT; ref_ptr GZERO_UINT; @@ -81,15 +80,12 @@ namespace spla { DECL_OP_BIN_S(PLUS_INT, PLUS, T_INT, { return a + b; }); DECL_OP_BIN_S(PLUS_UINT, PLUS, T_UINT, { return a + b; }); DECL_OP_BIN_S(PLUS_FLOAT, PLUS, T_FLOAT, { return a + b; }); - DECL_OP_BIN_S(MINUS_INT, MINUS, T_INT, { return a - b; }); DECL_OP_BIN_S(MINUS_UINT, MINUS, T_UINT, { return a - b; }); DECL_OP_BIN_S(MINUS_FLOAT, MINUS, T_FLOAT, { return a - b; }); - DECL_OP_BIN_S(MULT_INT, MULT, T_INT, { return a * b; }); DECL_OP_BIN_S(MULT_UINT, MULT, T_UINT, { return a * b; }); DECL_OP_BIN_S(MULT_FLOAT, MULT, T_FLOAT, { return a * b; }); - DECL_OP_BIN_S(DIV_INT, DIV, T_INT, { return a / b; }); DECL_OP_BIN_S(DIV_UINT, DIV, T_UINT, { return a / b; }); DECL_OP_BIN_S(DIV_FLOAT, DIV, T_FLOAT, { return a / b; }); @@ -97,7 +93,6 @@ namespace spla { DECL_OP_BIN_S(FIRST_INT, FIRST, T_INT, { return a; }); DECL_OP_BIN_S(FIRST_UINT, FIRST, T_UINT, { return a; }); DECL_OP_BIN_S(FIRST_FLOAT, FIRST, T_FLOAT, { return a; }); - DECL_OP_BIN_S(SECOND_INT, SECOND, T_INT, { return b; }); DECL_OP_BIN_S(SECOND_UINT, SECOND, T_UINT, { return b; }); DECL_OP_BIN_S(SECOND_FLOAT, SECOND, T_FLOAT, { return b; }); @@ -109,13 +104,16 @@ namespace spla { DECL_OP_BIN_S(MIN_INT, MIN, T_INT, { return min(a, b); }); DECL_OP_BIN_S(MIN_UINT, MIN, T_UINT, { return min(a, b); }); DECL_OP_BIN_S(MIN_FLOAT, MIN, T_FLOAT, { return min(a, b); }); - DECL_OP_BIN_S(MAX_INT, MAX, T_INT, { return max(a, b); }); DECL_OP_BIN_S(MAX_UINT, MAX, T_UINT, { return max(a, b); }); DECL_OP_BIN_S(MAX_FLOAT, MAX, T_FLOAT, { return max(a, b); }); - DECL_OP_BIN_S(OR_INT, OR, T_INT, { return a | b; }); - DECL_OP_BIN_S(OR_UINT, OR, T_UINT, { return a | b; }); + DECL_OP_BIN_S(BOR_INT, BOR, T_INT, { return a | b; }); + DECL_OP_BIN_S(BOR_UINT, BOR, T_UINT, { return a | b; }); + DECL_OP_BIN_S(BAND_INT, BAND, T_INT, { return a & b; }); + DECL_OP_BIN_S(BAND_UINT, BAND, T_UINT, { return a & b; }); + DECL_OP_BIN_S(BXOR_INT, BXOR, T_INT, { return a ^ b; }); + DECL_OP_BIN_S(BXOR_UINT, BXOR, T_UINT, { return a ^ b; }); } }// namespace spla \ No newline at end of file diff --git a/src/sequential/cpu_algo_registry.cpp b/src/sequential/cpu_algo_registry.cpp index 17429a794..98e2c82fc 100644 --- a/src/sequential/cpu_algo_registry.cpp +++ b/src/sequential/cpu_algo_registry.cpp @@ -46,6 +46,10 @@ namespace spla { g_registry->add(MAKE_KEY_CPU_1("v_reduce", MULT_INT), std::make_shared>()); g_registry->add(MAKE_KEY_CPU_1("v_reduce", MULT_UINT), std::make_shared>()); g_registry->add(MAKE_KEY_CPU_1("v_reduce", MULT_FLOAT), std::make_shared>()); + g_registry->add(MAKE_KEY_CPU_1("v_reduce", BOR_INT), std::make_shared>()); + g_registry->add(MAKE_KEY_CPU_1("v_reduce", BOR_UINT), std::make_shared>()); + g_registry->add(MAKE_KEY_CPU_1("v_reduce", BAND_INT), std::make_shared>()); + g_registry->add(MAKE_KEY_CPU_1("v_reduce", BAND_UINT), std::make_shared>()); g_registry->add(MAKE_KEY_CPU_1("v_assign_masked", PLUS_INT), std::make_shared>()); g_registry->add(MAKE_KEY_CPU_1("v_assign_masked", PLUS_UINT), std::make_shared>()); @@ -65,14 +69,18 @@ namespace spla { g_registry->add(MAKE_KEY_CPU_1("v_assign_masked", ONE_INT), std::make_shared>()); g_registry->add(MAKE_KEY_CPU_1("v_assign_masked", ONE_UINT), std::make_shared>()); g_registry->add(MAKE_KEY_CPU_1("v_assign_masked", ONE_FLOAT), std::make_shared>()); + g_registry->add(MAKE_KEY_CPU_1("v_assign_masked", BOR_INT), std::make_shared>()); + g_registry->add(MAKE_KEY_CPU_1("v_assign_masked", BOR_UINT), std::make_shared>()); + g_registry->add(MAKE_KEY_CPU_1("v_assign_masked", BAND_INT), std::make_shared>()); + g_registry->add(MAKE_KEY_CPU_1("v_assign_masked", BAND_UINT), std::make_shared>()); + g_registry->add(MAKE_KEY_CPU_1("v_assign_masked", BXOR_INT), std::make_shared>()); + g_registry->add(MAKE_KEY_CPU_1("v_assign_masked", BXOR_UINT), std::make_shared>()); - g_registry->add(MAKE_KEY_CPU_2_M("mxv_masked", MULT_INT, OR_INT, true), std::make_shared>()); - g_registry->add(MAKE_KEY_CPU_2_M("mxv_masked", MULT_UINT, OR_INT, true), std::make_shared>()); - + g_registry->add(MAKE_KEY_CPU_2_M("mxv_masked", BAND_INT, BOR_INT, true), std::make_shared>()); + g_registry->add(MAKE_KEY_CPU_2_M("mxv_masked", BAND_UINT, BOR_UINT, true), std::make_shared>()); g_registry->add(MAKE_KEY_CPU_2_M("mxv_masked", MULT_INT, PLUS_INT, true), std::make_shared>()); g_registry->add(MAKE_KEY_CPU_2_M("mxv_masked", MULT_UINT, PLUS_UINT, true), std::make_shared>()); g_registry->add(MAKE_KEY_CPU_2_M("mxv_masked", MULT_FLOAT, PLUS_FLOAT, true), std::make_shared>()); - g_registry->add(MAKE_KEY_CPU_2_M("mxv_masked", MIN_INT, PLUS_INT, true), std::make_shared>()); g_registry->add(MAKE_KEY_CPU_2_M("mxv_masked", MIN_UINT, PLUS_UINT, true), std::make_shared>()); g_registry->add(MAKE_KEY_CPU_2_M("mxv_masked", MIN_FLOAT, PLUS_FLOAT, true), std::make_shared>());