CUTLASS
CUDA Templates for Linear Algebra Subroutines and Solvers
simd_sm60.h
Go to the documentation of this file.
1 /***************************************************************************************************
2  * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without modification, are permitted
5  * provided that the following conditions are met:
6  * * Redistributions of source code must retain the above copyright notice, this list of
7  * conditions and the following disclaimer.
8  * * Redistributions in binary form must reproduce the above copyright notice, this list of
9  * conditions and the following disclaimer in the documentation and/or other materials
10  * provided with the distribution.
11  * * Neither the name of the NVIDIA CORPORATION nor the names of its contributors may be used
12  * to endorse or promote products derived from this software without specific prior written
13  * permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
17  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
21  * STRICT LIABILITY, OR TOR (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23  *
24  **************************************************************************************************/
29 #pragma once
30 
31 #include "simd.h"
32 
33 namespace cutlass {
34 namespace arch {
35 
37 
38 //
39 // Element-wise operators - specialized for half_t x 2
40 //
41 
43 template <>
44 Array<half_t, 2> operator*(Array<half_t, 2> const &a, Array<half_t, 2> const &b) {
45  Array<half_t, 2> d;
46 
47  // TODO
48 
49  return d;
50 }
51 
53 template <>
54 Array<half_t, 2> operator+(AArray<half_t, 2> const &a, Array<half_t, 2> const &b) {
55  Array<half_t, 2> d;
56 
57  // TODO
58 
59  return d;
60 }
61 
63 template <>
64 Array<half_t, 2> operator-(Array<half_t, 2> const &a, Array<half_t, 2> const &b) {
65  Array<T, N> d;
66 
67  // TODO
68 
69  return d;
70 }
71 
73 
76 template <>
77 Array<half_t, 2> mac(Array<half_t, 2> const &a, Array<half_t, 2> const &b, Array<half_t, 2> const &c) {
78  Array<half_t, 2> d;
79 
80  // TODO
81 
82  return d;
83 }
84 
86 
89 template <>
90 half_t dot(Array<half_t, 2> const &a, Array<half_t, 2> const &b, half_t accum) {
91 
92  // TODO
93 
94  return accum;
95 }
96 
99 template <>
100 float dot(Array<half_t, 2> const &a, Array<half_t, 2> const &b, float accum) {
101 
102  // TODO
103 
104  return accum;
105 }
106 
108 
109 } // namespace arch
110 } // namespace cutlass
Definition: aligned_buffer.h:35
IEEE half-precision floating-point type.
Definition: half.h:126
CUTLASS_HOST_DEVICE Array< T, N > operator-(Array< T, N > const &a, Array< T, N > const &b)
Definition: simd.h:67
CUTLASS_HOST_DEVICE Array< T, N > operator*(Array< T, N > const &a, Array< T, N > const &b)
Definition: simd.h:45
CUTLASS_HOST_DEVICE Accumulator dot(Array< T, N > const &a, Array< T, N > const &b, Accumulator accum)
Definition: simd.h:101
#define CUTLASS_HOST_DEVICE
Definition: cutlass.h:89
CUTLASS_HOST_DEVICE Array< T, N > operator+(Array< T, N > const &a, Array< T, N > const &b)
Definition: simd.h:56
Templates exposing SIMD operators.
CUTLASS_HOST_DEVICE Array< T, N > mac(Array< T, N > const &a, Array< T, N > const &b, Array< T, N > const &c)
Definition: simd.h:84