ALP User Documentation 0.7.alpha
Algebraic Programming User Documentation
Loading...
Searching...
No Matches
blas1.hpp
Go to the documentation of this file.
1
2/*
3 * Copyright 2021 Huawei Technologies Co., Ltd.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
27#ifndef _H_GRB_BASE_BLAS1
28#define _H_GRB_BASE_BLAS1
29
30#include <graphblas/rc.hpp>
31#include <graphblas/ops.hpp>
32#include <graphblas/phase.hpp>
33#include <graphblas/monoid.hpp>
37#include <graphblas/internalops.hpp>
38
39#include <assert.h>
40
41
42namespace grb {
43
154 #define NO_MASK Vector< bool >( 0 )
155
200 template<
202 class OP, enum Backend backend,
203 typename OutputType, typename InputType1, typename InputType2,
204 typename Coords
205 >
208 const InputType1 alpha,
209 const InputType2 beta,
210 const OP &op = OP(),
211 const Phase &phase = EXECUTE,
212 const typename std::enable_if<
217 >::type * const = nullptr
218 ) {
219#ifdef _DEBUG
220 std::cout << "In eWiseApply ([T1]<-T2<-T3), operator, base\n";
221#endif
222#ifndef NDEBUG
223 const bool should_not_call_eWiseApplyOpASS_base = false;
224 assert( should_not_call_eWiseApplyOpASS_base );
225#endif
226 (void) z;
227 (void) alpha;
228 (void) beta;
229 (void) op;
230 (void) phase;
231 return UNSUPPORTED;
232 }
233
278 template<
280 class Monoid, enum Backend backend,
281 typename OutputType, typename InputType1, typename InputType2,
282 typename Coords
283 >
286 const InputType1 alpha,
287 const InputType2 beta,
288 const Monoid &monoid = Monoid(),
289 const Phase &phase = EXECUTE,
290 const typename std::enable_if<
295 >::type * const = nullptr
296 ) {
297#ifdef _DEBUG
298 std::cout << "In eWiseApply ([T1]<-T2<-T3), monoid, base\n";
299#endif
300#ifndef NDEBUG
301 const bool should_not_call_eWiseApplyMonASS_base = false;
302 assert( should_not_call_eWiseApplyMonASS_base );
303#endif
304 (void) z;
305 (void) alpha;
306 (void) beta;
307 (void) monoid;
308 (void) phase;
309 return UNSUPPORTED;
310 }
311
387 template<
389 class OP, enum Backend backend,
390 typename OutputType, typename InputType1, typename InputType2,
391 typename Coords
392 >
395 const InputType1 alpha,
397 const OP &op = OP(),
398 const Phase &phase = EXECUTE,
399 const typename std::enable_if<
404 >::type * const = nullptr
405 ) {
406#ifdef _DEBUG
407 std::cout << "In eWiseApply ([T1]<-T2<-[T3]), operator, base\n";
408#endif
409#ifndef NDEBUG
410 const bool should_not_call_eWiseApplyOpASA_base = false;
411 assert( should_not_call_eWiseApplyOpASA_base );
412#endif
413 (void) z;
414 (void) alpha;
415 (void) y;
416 (void) op;
417 (void) phase;
418 return UNSUPPORTED;
419 }
420
496 template<
498 class OP, enum Backend backend,
499 typename OutputType, typename MaskType,
500 typename InputType1, typename InputType2,
501 typename Coords
502 >
506 const InputType1 alpha,
508 const OP &op = OP(),
509 const Phase &phase = EXECUTE,
510 const typename std::enable_if<
516 >::type * const = nullptr
517 ) {
518#ifdef _DEBUG
519 std::cout << "In masked eWiseApply ([T1]<-T2<-[T3], operator, base)\n";
520#endif
521#ifndef NDEBUG
522 const bool should_not_call_eWiseApplyOpAMSA_base = false;
523 assert( should_not_call_eWiseApplyOpAMSA_base );
524#endif
525 (void) z;
526 (void) mask;
527 (void) alpha;
528 (void) y;
529 (void) op;
530 (void) phase;
531 return UNSUPPORTED;
532 }
533
608 template<
610 class Monoid, enum Backend backend,
611 typename OutputType, typename InputType1, typename InputType2,
612 typename Coords
613 >
616 const InputType1 alpha,
618 const Monoid &monoid = Monoid(),
619 const Phase &phase = EXECUTE,
620 const typename std::enable_if< !grb::is_object< OutputType >::value &&
624 >::type * const = nullptr
625 ) {
626#ifdef _DEBUG
627 std::cout << "In unmasked eWiseApply ([T1]<-T2<-[T3], monoid, base)\n";
628#endif
629#ifndef NDEBUG
630 const bool should_not_call_eWiseApplyMonoidASA_base = false;
631 assert( should_not_call_eWiseApplyMonoidASA_base );
632#endif
633 (void) z;
634 (void) alpha;
635 (void) y;
636 (void) monoid;
637 (void) phase;
638 return UNSUPPORTED;
639 }
640
719 template<
721 class Monoid, enum Backend backend,
722 typename OutputType, typename MaskType,
723 typename InputType1, typename InputType2,
724 typename Coords
725 >
729 const InputType1 alpha,
731 const Monoid &monoid = Monoid(),
732 const Phase &phase = EXECUTE,
733 const typename std::enable_if< !grb::is_object< OutputType >::value &&
738 void >::type * const = nullptr
739 ) {
740#ifdef _DEBUG
741 std::cout << "In masked eWiseApply ([T1]<-T2<-[T3], using monoid)\n";
742#endif
743#ifndef NDEBUG
744 const bool should_not_call_eWiseApplyMonoidAMSA_base = false;
745 assert( should_not_call_eWiseApplyMonoidAMSA_base );
746#endif
747 (void) z;
748 (void) mask;
749 (void) alpha;
750 (void) y;
751 (void) monoid;
752 (void) phase;
753 return UNSUPPORTED;
754 }
755
832 template<
834 class OP, enum Backend backend,
835 typename OutputType, typename InputType1, typename InputType2,
836 typename Coords
837 >
841 const InputType2 beta,
842 const OP &op = OP(),
843 const Phase &phase = EXECUTE,
844 const typename std::enable_if<
849 >::type * const = nullptr
850 ) {
851#ifdef _DEBUG
852 std::cout << "In eWiseApply ([T1]<-[T2]<-T3), operator, base\n";
853#endif
854#ifndef NDEBUG
855 const bool should_not_call_eWiseApplyOpAAS_base = false;
856 assert( should_not_call_eWiseApplyOpAAS_base );
857#endif
858 (void) z;
859 (void) x;
860 (void) beta;
861 (void) op;
862 (void) phase;
863 return UNSUPPORTED;
864 }
865
943 template<
945 class OP, enum Backend backend,
946 typename OutputType, typename MaskType,
947 typename InputType1, typename InputType2,
948 typename Coords
949 >
954 const InputType2 beta,
955 const OP &op = OP(),
956 const Phase &phase = EXECUTE,
957 const typename std::enable_if< !grb::is_object< OutputType >::value &&
962 >::type * const = nullptr
963 ) {
964#ifdef _DEBUG
965 std::cout << "In masked eWiseApply ([T1]<-[T2]<-T3, operator, base)\n";
966#endif
967#ifndef NDEBUG
968 const bool should_not_call_eWiseApplyOpAMAS_base = false;
969 assert( should_not_call_eWiseApplyOpAMAS_base );
970#endif
971 (void) z;
972 (void) mask;
973 (void) x;
974 (void) beta;
975 (void) op;
976 (void) phase;
977 return UNSUPPORTED;
978 }
979
1054 template<
1056 class Monoid, enum Backend backend,
1057 typename OutputType, typename InputType1, typename InputType2,
1058 typename Coords
1059 >
1063 const InputType2 beta,
1064 const Monoid &monoid = Monoid(),
1065 const Phase &phase = EXECUTE,
1066 const typename std::enable_if< !grb::is_object< OutputType >::value &&
1070 void >::type * const = nullptr
1071 ) {
1072#ifdef _DEBUG
1073 std::cout << "In unmasked eWiseApply ([T1]<-[T2]<-T3, monoid, base)\n";
1074#endif
1075#ifndef NDEBUG
1076 const bool should_not_call_eWiseApplyMonoidAAS_base = false;
1077 assert( should_not_call_eWiseApplyMonoidAAS_base );
1078#endif
1079 (void) z;
1080 (void) x;
1081 (void) beta;
1082 (void) monoid;
1083 (void) phase;
1084 return UNSUPPORTED;
1085 }
1086
1165 template<
1167 class Monoid, enum Backend backend,
1168 typename OutputType, typename MaskType,
1169 typename InputType1, typename InputType2,
1170 typename Coords
1171 >
1176 const InputType2 beta,
1177 const Monoid &monoid = Monoid(),
1178 const Phase &phase = EXECUTE,
1179 const typename std::enable_if< !grb::is_object< OutputType >::value &&
1184 >::type * const = nullptr
1185 ) {
1186#ifdef _DEBUG
1187 std::cout << "In masked eWiseApply ([T1]<-[T2]<-T3, monoid, base)\n";
1188#endif
1189#ifndef NDEBUG
1190 const bool should_not_call_eWiseApplyMonoidAMAS_base = false;
1191 assert( should_not_call_eWiseApplyMonoidAMAS_base );
1192#endif
1193 (void) z;
1194 (void) mask;
1195 (void) x;
1196 (void) beta;
1197 (void) monoid;
1198 (void) phase;
1199 return UNSUPPORTED;
1200 }
1201
1278 template<
1280 class OP, enum Backend backend,
1281 typename OutputType, typename InputType1, typename InputType2,
1282 typename Coords
1283 >
1288 const OP &op = OP(),
1289 const Phase &phase = EXECUTE,
1290 const typename std::enable_if< !grb::is_object< OutputType >::value &&
1294 >::type * const = nullptr
1295 ) {
1296#ifdef _DEBUG
1297 std::cout << "In eWiseApply ([T1]<-[T2]<-[T3]), operator variant\n";
1298#endif
1299#ifndef NDEBUG
1300 const bool should_not_call_eWiseApplyOpAAA_base = false;
1301 assert( should_not_call_eWiseApplyOpAAA_base );
1302#endif
1303 (void) z;
1304 (void) x;
1305 (void) y;
1306 (void) op;
1307 (void) phase;
1308 return UNSUPPORTED;
1309 }
1310
1390 template<
1392 class OP, enum Backend backend,
1393 typename OutputType, typename MaskType,
1394 typename InputType1, typename InputType2,
1395 typename Coords
1396 >
1402 const OP &op = OP(),
1403 const Phase &phase = EXECUTE,
1404 const typename std::enable_if<
1410 >::type * const = nullptr
1411 ) {
1412#ifdef _DEBUG
1413 std::cout << "In masked eWiseApply ([T1]<-[T2]<-[T3], operator, base)\n";
1414#endif
1415#ifndef NDEBUG
1416 const bool should_not_call_eWiseApplyOpAMAA_base = false;
1417 assert( should_not_call_eWiseApplyOpAMAA_base );
1418#endif
1419 (void) z;
1420 (void) mask;
1421 (void) x;
1422 (void) y;
1423 (void) op;
1424 (void) phase;
1425 return UNSUPPORTED;
1426 }
1427
1505 template<
1507 class Monoid, enum Backend backend,
1508 typename OutputType, typename InputType1, typename InputType2,
1509 typename Coords
1510 >
1515 const Monoid &monoid = Monoid(),
1516 const Phase &phase = EXECUTE,
1517 const typename std::enable_if< !grb::is_object< OutputType >::value &&
1521 >::type * const = nullptr
1522 ) {
1523#ifdef _DEBUG
1524 std::cout << "In unmasked eWiseApply ([T1]<-[T2]<-[T3], monoid, base)\n";
1525#endif
1526#ifndef NDEBUG
1527 const bool should_not_call_eWiseApplyOpAMAA_base = false;
1528 assert( should_not_call_eWiseApplyOpAMAA_base );
1529#endif
1530 (void) z;
1531 (void) x;
1532 (void) y;
1533 (void) monoid;
1534 (void) phase;
1535 return UNSUPPORTED;
1536 }
1537
1613 template<
1615 class Monoid, enum Backend backend,
1616 typename OutputType, typename MaskType,
1617 typename InputType1, typename InputType2,
1618 typename Coords
1619 >
1625 const Monoid &monoid = Monoid(),
1626 const Phase &phase = EXECUTE,
1627 const typename std::enable_if<
1633 >::type * const = nullptr
1634 ) {
1635#ifdef _DEBUG
1636 std::cout << "In masked eWiseApply ([T1]<-[T2]<-[T3], monoid, base)\n";
1637#endif
1638#ifndef NDEBUG
1639 const bool should_not_call_eWiseApplyMonoidAMAA_base = false;
1640 assert( should_not_call_eWiseApplyMonoidAMAA_base );
1641#endif
1642 (void) z;
1643 (void) mask;
1644 (void) x;
1645 (void) y;
1646 (void) monoid;
1647 (void) phase;
1648 return UNSUPPORTED;
1649 }
1650
1730 template<
1732 class Ring, enum Backend backend,
1733 typename OutputType, typename InputType1, typename InputType2,
1734 typename Coords
1735 >
1740 const Ring &ring = Ring(),
1741 const Phase &phase = EXECUTE,
1742 const typename std::enable_if< !grb::is_object< OutputType >::value &&
1746 >::type * const = nullptr
1747 ) {
1748#ifdef _DEBUG
1749 std::cout << "in eWiseAdd ([T1] <- [T2] + [T3]), unmasked, base";
1750#endif
1751#ifndef NDEBUG
1752 const bool should_not_call_eWiseAddAAA_base = false;
1753 assert( should_not_call_eWiseAddAAA_base );
1754#endif
1755 (void) z;
1756 (void) x;
1757 (void) y;
1758 (void) ring;
1759 (void) phase;
1760 return UNSUPPORTED;
1761 }
1762
1837 template<
1839 class Ring, enum Backend backend,
1840 typename InputType1, typename InputType2, typename OutputType,
1841 typename Coords
1842 >
1845 const InputType1 alpha,
1847 const Ring &ring = Ring(),
1848 const Phase &phase = EXECUTE,
1849 const typename std::enable_if< !grb::is_object< OutputType >::value &&
1853 >::type * const = nullptr
1854 ) {
1855#ifdef _DEBUG
1856 std::cout << "in eWiseAdd ([T1] <- T2 + [T3]), unmasked, base";
1857#endif
1858#ifndef NDEBUG
1859 const bool should_not_call_eWiseAddASA_base = false;
1860 assert( should_not_call_eWiseAddASA_base );
1861#endif
1862 (void) z;
1863 (void) alpha;
1864 (void) y;
1865 (void) ring;
1866 (void) phase;
1867 return UNSUPPORTED;
1868 }
1869
1944 template<
1946 class Ring, enum Backend backend,
1947 typename InputType1, typename InputType2, typename OutputType,
1948 typename Coords
1949 >
1953 const InputType2 beta,
1954 const Ring &ring = Ring(),
1955 const Phase &phase = EXECUTE,
1956 const typename std::enable_if< !grb::is_object< OutputType >::value &&
1960 >::type * const = nullptr
1961 ) {
1962#ifdef _DEBUG
1963 std::cout << "in eWiseAdd ([T1] <- [T2] + T3), unmasked, base";
1964#endif
1965#ifndef NDEBUG
1966 const bool should_not_call_eWiseAddAAS_base = false;
1967 assert( should_not_call_eWiseAddAAS_base );
1968#endif
1969 (void) z;
1970 (void) x;
1971 (void) beta;
1972 (void) ring;
1973 (void) phase;
1974 return UNSUPPORTED;
1975 }
1976
2047 template<
2049 class Ring, enum Backend backend,
2050 typename InputType1, typename InputType2, typename OutputType,
2051 typename Coords
2052 >
2055 const InputType1 alpha,
2056 const InputType2 beta,
2057 const Ring &ring = Ring(),
2058 const Phase &phase = EXECUTE,
2059 const typename std::enable_if< !grb::is_object< OutputType >::value &&
2063 >::type * const = nullptr
2064 ) {
2065#ifdef _DEBUG
2066 std::cout << "in eWiseAdd ([T1] <- T2 + T3), unmasked, base";
2067#endif
2068#ifndef NDEBUG
2069 const bool should_not_call_eWiseAddASS_base = false;
2070 assert( should_not_call_eWiseAddASS_base );
2071#endif
2072 (void) z;
2073 (void) alpha;
2074 (void) beta;
2075 (void) ring;
2076 (void) phase;
2077 return UNSUPPORTED;
2078 }
2079
2165 template<
2167 class Ring, enum Backend backend,
2168 typename OutputType, typename MaskType,
2169 typename InputType1, typename InputType2,
2170 typename Coords
2171 >
2177 const Ring &ring = Ring(),
2178 const Phase &phase = EXECUTE,
2179 const typename std::enable_if< !grb::is_object< OutputType >::value &&
2183 >::type * const = nullptr
2184 ) {
2185#ifdef _DEBUG
2186 std::cout << "in eWiseAdd ([T1] <- [T2] + [T3]), masked, base";
2187#endif
2188#ifndef NDEBUG
2189 const bool should_not_call_eWiseAddAMAA_base = false;
2190 assert( should_not_call_eWiseAddAMAA_base );
2191#endif
2192 (void) z;
2193 (void) mask;
2194 (void) x;
2195 (void) y;
2196 (void) ring;
2197 (void) phase;
2198 return UNSUPPORTED;
2199 }
2200
2282 template<
2284 class Ring, enum Backend backend,
2285 typename InputType1, typename InputType2,
2286 typename OutputType, typename MaskType,
2287 typename Coords
2288 >
2292 const InputType1 alpha,
2294 const Ring &ring = Ring(),
2295 const Phase &phase = EXECUTE,
2296 const typename std::enable_if< !grb::is_object< OutputType >::value &&
2300 >::type * const = nullptr
2301 ) {
2302#ifdef _DEBUG
2303 std::cout << "in eWiseAdd ([T1] <- T2 + [T3]), masked, base";
2304#endif
2305#ifndef NDEBUG
2306 const bool should_not_call_eWiseAddAMSA_base = false;
2307 assert( should_not_call_eWiseAddAMSA_base );
2308#endif
2309 (void) z;
2310 (void) mask;
2311 (void) alpha;
2312 (void) y;
2313 (void) ring;
2314 (void) phase;
2315 return UNSUPPORTED;
2316 }
2317
2399 template<
2401 class Ring, enum Backend backend,
2402 typename InputType1, typename InputType2,
2403 typename OutputType, typename MaskType,
2404 typename Coords
2405 >
2410 const InputType2 beta,
2411 const Ring &ring = Ring(),
2412 const Phase &phase = EXECUTE,
2413 const typename std::enable_if< !grb::is_object< OutputType >::value &&
2417 >::type * const = nullptr
2418 ) {
2419#ifdef _DEBUG
2420 std::cout << "in eWiseAdd ([T1] <- [T2] + T3), masked, base";
2421#endif
2422#ifndef NDEBUG
2423 const bool should_not_call_eWiseAddAMAS_base = false;
2424 assert( should_not_call_eWiseAddAMAS_base );
2425#endif
2426 (void) z;
2427 (void) mask;
2428 (void) x;
2429 (void) beta;
2430 (void) ring;
2431 (void) phase;
2432 return UNSUPPORTED;
2433 }
2434
2512 template<
2514 class Ring, enum Backend backend,
2515 typename InputType1, typename InputType2,
2516 typename OutputType, typename MaskType,
2517 typename Coords
2518 >
2522 const InputType1 alpha,
2523 const InputType2 beta,
2524 const Ring &ring = Ring(),
2525 const Phase &phase = EXECUTE,
2526 const typename std::enable_if< !grb::is_object< OutputType >::value &&
2530 >::type * const = nullptr
2531 ) {
2532#ifdef _DEBUG
2533 std::cout << "in eWiseAdd ([T1] <- T2 + T3), masked, base";
2534#endif
2535#ifndef NDEBUG
2536 const bool should_not_call_eWiseAddAMSS_base = false;
2537 assert( should_not_call_eWiseAddAMSS_base );
2538#endif
2539 (void) z;
2540 (void) mask;
2541 (void) alpha;
2542 (void) beta;
2543 (void) ring;
2544 (void) phase;
2545 return UNSUPPORTED;
2546 }
2547
2612 template<
2614 class Ring, enum Backend backend,
2615 typename InputType1, typename InputType2, typename OutputType,
2616 typename Coords
2617 >
2622 const Ring &ring = Ring(),
2623 const Phase &phase = EXECUTE,
2624 const typename std::enable_if< !grb::is_object< OutputType >::value &&
2628 >::type * const = nullptr
2629 ) {
2630#ifdef _DEBUG
2631 std::cout << "in eWiseMul ([T1] <- [T2] * [T3]), unmasked, base";
2632#endif
2633#ifndef NDEBUG
2634 const bool should_not_call_eWiseMulAAA_base = false;
2635 assert( should_not_call_eWiseMulAAA_base );
2636#endif
2637 (void) z;
2638 (void) x;
2639 (void) y;
2640 (void) ring;
2641 (void) phase;
2642 return UNSUPPORTED;
2643 }
2644
2709 template<
2711 class Ring, enum Backend backend,
2712 typename InputType1, typename InputType2, typename OutputType,
2713 typename Coords
2714 >
2717 const InputType1 alpha,
2719 const Ring &ring = Ring(),
2720 const Phase &phase = EXECUTE,
2721 const typename std::enable_if< !grb::is_object< OutputType >::value &&
2725 >::type * const = nullptr
2726 ) {
2727#ifdef _DEBUG
2728 std::cout << "in eWiseMul ([T1] <- T2 * [T3]), unmasked, base";
2729#endif
2730#ifndef NDEBUG
2731 const bool should_not_call_eWiseMulASA_base = false;
2732 assert( should_not_call_eWiseMulASA_base );
2733#endif
2734 (void) z;
2735 (void) alpha;
2736 (void) y;
2737 (void) ring;
2738 (void) phase;
2739 return UNSUPPORTED;
2740 }
2741
2806 template<
2808 class Ring, enum Backend backend,
2809 typename InputType1, typename InputType2, typename OutputType,
2810 typename Coords
2811 >
2815 const InputType2 beta,
2816 const Ring &ring = Ring(),
2817 const Phase &phase = EXECUTE,
2818 const typename std::enable_if< !grb::is_object< OutputType >::value &&
2822 >::type * const = nullptr
2823 ) {
2824#ifdef _DEBUG
2825 std::cout << "in eWiseMul ([T1] <- [T2] * T3), unmasked, base";
2826#endif
2827#ifndef NDEBUG
2828 const bool should_not_call_eWiseMulAAS_base = false;
2829 assert( should_not_call_eWiseMulAAS_base );
2830#endif
2831 (void) z;
2832 (void) x;
2833 (void) beta;
2834 (void) ring;
2835 (void) phase;
2836 return UNSUPPORTED;
2837 }
2838
2899 template<
2901 class Ring, enum Backend backend,
2902 typename InputType1, typename InputType2, typename OutputType,
2903 typename Coords
2904 >
2907 const InputType1 alpha,
2908 const InputType2 beta,
2909 const Ring &ring = Ring(),
2910 const Phase &phase = EXECUTE,
2911 const typename std::enable_if< !grb::is_object< OutputType >::value &&
2915 >::type * const = nullptr
2916 ) {
2917#ifdef _DEBUG
2918 std::cout << "in eWiseMul ([T1] <- T2 * T3), unmasked, base";
2919#endif
2920#ifndef NDEBUG
2921 const bool should_not_call_eWiseMulASS_base = false;
2922 assert( should_not_call_eWiseMulASS_base );
2923#endif
2924 (void) z;
2925 (void) alpha;
2926 (void) beta;
2927 (void) ring;
2928 (void) phase;
2929 return UNSUPPORTED;
2930 }
2931
3001 template<
3003 class Ring, enum Backend backend,
3004 typename InputType1, typename InputType2,
3005 typename OutputType, typename MaskType,
3006 typename Coords
3007 >
3013 const Ring &ring = Ring(),
3014 const Phase &phase = EXECUTE,
3015 const typename std::enable_if< !grb::is_object< OutputType >::value &&
3019 >::type * const = nullptr
3020 ) {
3021#ifdef _DEBUG
3022 std::cout << "in eWiseMul ([T1] <- [T2] * [T3]), masked, base";
3023#endif
3024#ifndef NDEBUG
3025 const bool should_not_call_eWiseMulAMAA_base = false;
3026 assert( should_not_call_eWiseMulAMAA_base );
3027#endif
3028 (void) z;
3029 (void) mask;
3030 (void) x;
3031 (void) y;
3032 (void) ring;
3033 (void) phase;
3034 return UNSUPPORTED;
3035 }
3036
3106 template<
3108 class Ring, enum Backend backend,
3109 typename InputType1, typename InputType2,
3110 typename OutputType, typename MaskType,
3111 typename Coords
3112 >
3116 const InputType1 alpha,
3118 const Ring &ring = Ring(),
3119 const Phase &phase = EXECUTE,
3120 const typename std::enable_if< !grb::is_object< OutputType >::value &&
3124 >::type * const = nullptr
3125 ) {
3126#ifdef _DEBUG
3127 std::cout << "in eWiseMul ([T1] <- T2 * [T3]), masked, base";
3128#endif
3129#ifndef NDEBUG
3130 const bool should_not_call_eWiseMulAMSA_base = false;
3131 assert( should_not_call_eWiseMulAMSA_base );
3132#endif
3133 (void) z;
3134 (void) mask;
3135 (void) alpha;
3136 (void) y;
3137 (void) ring;
3138 (void) phase;
3139 return UNSUPPORTED;
3140 }
3141
3211 template<
3213 class Ring, enum Backend backend,
3214 typename InputType1, typename InputType2,
3215 typename OutputType, typename MaskType,
3216 typename Coords
3217 >
3222 const InputType2 beta,
3223 const Ring &ring = Ring(),
3224 const Phase &phase = EXECUTE,
3225 const typename std::enable_if< !grb::is_object< OutputType >::value &&
3229 >::type * const = nullptr
3230 ) {
3231#ifdef _DEBUG
3232 std::cout << "in eWiseMul ([T1] <- [T2] * T3), masked, base";
3233#endif
3234#ifndef NDEBUG
3235 const bool should_not_call_eWiseMulAMAS_base = false;
3236 assert( should_not_call_eWiseMulAMAS_base );
3237#endif
3238 (void) z;
3239 (void) mask;
3240 (void) x;
3241 (void) beta;
3242 (void) ring;
3243 (void) phase;
3244 return UNSUPPORTED;
3245 }
3246
3313 template<
3315 class Ring, enum Backend backend,
3316 typename InputType1, typename InputType2,
3317 typename OutputType, typename MaskType,
3318 typename Coords
3319 >
3323 const InputType1 alpha,
3324 const InputType2 beta,
3325 const Ring &ring = Ring(),
3326 const Phase &phase = EXECUTE,
3327 const typename std::enable_if< !grb::is_object< OutputType >::value &&
3331 >::type * const = nullptr
3332 ) {
3333#ifdef _DEBUG
3334 std::cout << "in eWiseMul ([T1] <- T2 * T3), masked, base";
3335#endif
3336#ifndef NDEBUG
3337 const bool should_not_call_eWiseMulAMSS_base = false;
3338 assert( should_not_call_eWiseMulAMSS_base );
3339#endif
3340 (void) z;
3341 (void) mask;
3342 (void) alpha;
3343 (void) beta;
3344 (void) ring;
3345 (void) phase;
3346 return UNSUPPORTED;
3347 }
3348
3517 template<
3518 typename Func,
3519 typename DataType,
3520 Backend backend,
3521 typename Coords,
3522 typename... Args
3523 >
3525 const Func f,
3526 const Vector< DataType, backend, Coords > & x, Args...
3527 ) {
3528#ifndef NDEBUG
3529 const bool should_not_call_base_vector_ewiselambda = false;
3530 assert( should_not_call_base_vector_ewiselambda );
3531#endif
3532 (void) f;
3533 (void) x;
3534 return UNSUPPORTED;
3535 }
3536
3612 template<
3614 class Monoid,
3615 typename InputType, typename IOType, typename MaskType,
3616 Backend backend, typename Coords
3617 >
3619 IOType &x,
3622 const Monoid &monoid = Monoid(),
3623 const typename std::enable_if< !grb::is_object< IOType >::value &&
3627 >::type * const = nullptr
3628 ) {
3629#ifndef NDEBUG
3630 const bool should_not_call_base_scalar_foldl = false;
3631 assert( should_not_call_base_scalar_foldl );
3632#endif
3633 (void) y;
3634 (void) x;
3635 (void) mask;
3636 (void) monoid;
3637 return UNSUPPORTED;
3638 }
3639
3645 template<
3647 class Monoid,
3648 typename IOType, typename InputType,
3649 Backend backend,
3650 typename Coords
3651 >
3653 IOType &x,
3655 const Monoid &monoid = Monoid(),
3656 const typename std::enable_if<
3659 void >::type * const = nullptr
3660 ) {
3661#ifndef NDEBUG
3662 const bool should_not_call_base_scalar_foldl_nomask = false;
3663 assert( should_not_call_base_scalar_foldl_nomask );
3664#endif
3665 (void) y;
3666 (void) x;
3667 (void) monoid;
3668 return UNSUPPORTED;
3669 }
3670
3681 template<
3683 class OP,
3684 typename IOType, typename InputType, typename MaskType,
3685 Backend backend, typename Coords
3686 >
3688 IOType &x,
3691 const OP &op = OP(),
3692 const typename std::enable_if<
3696 void >::type * const = nullptr
3697 ) {
3698#ifndef NDEBUG
3699 const bool should_not_call_base_scalar_foldl_op = false;
3700 assert( should_not_call_base_scalar_foldl_op );
3701#endif
3702 (void) x;
3703 (void) y;
3704 (void) mask;
3705 (void) op;
3706 return UNSUPPORTED;
3707 }
3708
3715 template<
3717 class Monoid,
3718 typename InputType, typename IOType, typename MaskType,
3719 Backend backend, typename Coords
3720 >
3724 IOType &y,
3725 const Monoid &monoid = Monoid(),
3726 const typename std::enable_if< !grb::is_object< IOType >::value &&
3730 >::type * const = nullptr
3731 ) {
3732#ifndef NDEBUG
3733 const bool should_not_call_base_scalar_foldr = false;
3734 assert( should_not_call_base_scalar_foldr );
3735#endif
3736 (void) y;
3737 (void) x;
3738 (void) mask;
3739 (void) monoid;
3740 return UNSUPPORTED;
3741 }
3742
3749 template<
3751 class Monoid,
3752 typename IOType, typename InputType,
3753 Backend backend, typename Coords
3754 >
3757 IOType &x,
3758 const Monoid &monoid = Monoid(),
3759 const typename std::enable_if<
3762 void >::type * const = nullptr
3763 ) {
3764#ifndef NDEBUG
3765 const bool should_not_call_base_scalar_foldr_nomask = false;
3766 assert( should_not_call_base_scalar_foldr_nomask );
3767#endif
3768 (void) y;
3769 (void) x;
3770 (void) monoid;
3771 return UNSUPPORTED;
3772 }
3773
3828 template<
3830 class AddMonoid, class AnyOp,
3831 typename OutputType, typename InputType1, typename InputType2,
3832 enum Backend backend, typename Coords
3833 >
3835 OutputType &z,
3838 const AddMonoid &addMonoid = AddMonoid(),
3839 const AnyOp &anyOp = AnyOp(),
3840 const Phase &phase = EXECUTE,
3841 const typename std::enable_if< !grb::is_object< OutputType >::value &&
3846 void >::type * const = nullptr
3847 ) {
3848#ifdef _DEBUG
3849 std::cout << "Should not call base grb::dot (monoid-operator version)\n";
3850#endif
3851#ifndef NDEBUG
3852 const bool should_not_call_base_dot_monOp = false;
3853 assert( should_not_call_base_dot_monOp );
3854#endif
3855 (void) z;
3856 (void) x;
3857 (void) y;
3858 (void) addMonoid;
3859 (void) anyOp;
3860 (void) phase;
3861 return UNSUPPORTED;
3862 }
3863
3906 template<
3908 class Ring,
3909 typename IOType, typename InputType1, typename InputType2,
3910 Backend backend, typename Coords
3911 >
3913 IOType &z,
3916 const Ring &ring = Ring(),
3917 const Phase &phase = EXECUTE,
3918 const typename std::enable_if<
3923 void >::type * const = nullptr
3924 ) {
3925#ifdef _DEBUG
3926 std::cout << "Should not call base grb::dot (semiring version)\n";
3927#endif
3928#ifndef NDEBUG
3929 const bool should_not_call_base_dot_semiring = false;
3930 assert( should_not_call_base_dot_semiring );
3931#endif
3932 (void) z;
3933 (void) x;
3934 (void) y;
3935 (void) ring;
3936 (void) phase;
3937 return UNSUPPORTED;
3938 }
3939
3942} // end namespace grb
3943
3944#endif // end _H_GRB_BASE_BLAS1
3945
This file contains a register of all backends that are either implemented, under implementation,...
A generalised monoid.
Definition: monoid.hpp:54
A GraphBLAS vector.
Definition: vector.hpp:64
Defines all ALP/GraphBLAS descriptors.
RC foldl(IOType &x, const Vector< InputType, backend, Coords > &y, const Vector< MaskType, backend, Coords > &mask, const Monoid &monoid=Monoid(), const typename std::enable_if< !grb::is_object< IOType >::value &&!grb::is_object< InputType >::value &&!grb::is_object< MaskType >::value &&grb::is_monoid< Monoid >::value, void >::type *const =nullptr)
Reduces, or folds, a vector into a scalar.
Definition: blas1.hpp:3618
RC eWiseApply(Vector< OutputType, backend, Coords > &z, const InputType1 alpha, const InputType2 beta, const OP &op=OP(), const Phase &phase=EXECUTE, const typename std::enable_if< !grb::is_object< OutputType >::value &&!grb::is_object< InputType1 >::value &&!grb::is_object< InputType2 >::value &&grb::is_operator< OP >::value, void >::type *const =nullptr)
Computes , out of place, operator version.
Definition: blas1.hpp:206
RC dot(OutputType &z, const Vector< InputType1, backend, Coords > &x, const Vector< InputType2, backend, Coords > &y, const AddMonoid &addMonoid=AddMonoid(), const AnyOp &anyOp=AnyOp(), const Phase &phase=EXECUTE, const typename std::enable_if< !grb::is_object< OutputType >::value &&!grb::is_object< InputType1 >::value &&!grb::is_object< InputType2 >::value &&grb::is_monoid< AddMonoid >::value &&grb::is_operator< AnyOp >::value, void >::type *const =nullptr)
Calculates the dot product, , under a given additive monoid and multiplicative operator.
Definition: blas1.hpp:3834
RC foldr(const Vector< InputType, backend, Coords > &x, const Vector< MaskType, backend, Coords > &mask, IOType &y, const Monoid &monoid=Monoid(), const typename std::enable_if< !grb::is_object< IOType >::value &&!grb::is_object< InputType >::value &&!grb::is_object< MaskType >::value &&grb::is_monoid< Monoid >::value, void >::type *const =nullptr)
Folds a vector into a scalar, right-to-left.
Definition: blas1.hpp:3721
RC eWiseMul(Vector< OutputType, backend, Coords > &z, const Vector< InputType1, backend, Coords > &x, const Vector< InputType2, backend, Coords > &y, const Ring &ring=Ring(), const Phase &phase=EXECUTE, const typename std::enable_if< !grb::is_object< OutputType >::value &&!grb::is_object< InputType1 >::value &&!grb::is_object< InputType2 >::value &&grb::is_semiring< Ring >::value, void >::type *const =nullptr)
In-place element-wise multiplication of two vectors, , under a given semiring.
Definition: blas1.hpp:2618
RC eWiseLambda(const Func f, const Vector< DataType, backend, Coords > &x, Args...)
Executes an arbitrary element-wise user-defined function f using any number of vectors of equal lengt...
Definition: blas1.hpp:3524
RC eWiseAdd(Vector< OutputType, backend, Coords > &z, const Vector< InputType1, backend, Coords > &x, const Vector< InputType2, backend, Coords > &y, const Ring &ring=Ring(), const Phase &phase=EXECUTE, const typename std::enable_if< !grb::is_object< OutputType >::value &&!grb::is_object< InputType1 >::value &&!grb::is_object< InputType2 >::value &&grb::is_semiring< Ring >::value, void >::type *const =nullptr)
Calculates the element-wise addition of two vectors, , under a given semiring.
Definition: blas1.hpp:1736
Backend
A collection of all backends.
Definition: backends.hpp:46
Provides an ALP monoid.
static constexpr Descriptor no_operation
Indicates no additional pre- or post-processing on any of the GraphBLAS function arguments.
Definition: descriptors.hpp:63
The ALP/GraphBLAS namespace.
Definition: graphblas.hpp:450
RC
Return codes of ALP primitives.
Definition: rc.hpp:47
@ UNSUPPORTED
Indicates that the execution of the requested primitive with the given arguments is not supported by ...
Definition: rc.hpp:129
unsigned int Descriptor
Descriptors indicate pre- or post-processing for some or all of the arguments to an ALP/GraphBLAS cal...
Definition: descriptors.hpp:54
Phase
Primitives with sparse ALP/GraphBLAS output containers may run into the issue where an appropriate gr...
Definition: phase.hpp:152
@ EXECUTE
Speculatively assumes that the output container of the requested operation has enough capacity to com...
Definition: phase.hpp:257
Provides a set of standard binary operators.
Defines the various phases an ALP/GraphBLAS primitive may be executed with.
Defines the ALP error codes.
Provides an ALP semiring.
Used to inspect whether a given type is an ALP monoid.
Definition: type_traits.hpp:85
Used to inspect whether a given type is an ALP/GraphBLAS object.
Definition: type_traits.hpp:130
Used to inspect whether a given type is an ALP operator.
Definition: type_traits.hpp:104
Used to inspect whether a given type is an ALP semiring.
Definition: type_traits.hpp:66