Back to Cutlass

CUTLASS: array.h Source File

docs/array_8h_source.html

4.4.251.0 KB
Original Source

| | CUTLASS

CUDA Templates for Linear Algebra Subroutines and Solvers |

array.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 **************************************************************************************************/

30 #pragma once

31 #include "cutlass/cutlass.h"

32 #include "cutlass/numeric_types.h"

33

34 namespace cutlass {

35

37

39 template <

40typename T,

41int N,

42bool RegisterSized = sizeof_bits<T>::value >= 32

43 >

44 class Array;

45

47

49 template <typename T, int N, bool RegisterSized>

50 struct sizeof_bits<Array<T, N, RegisterSized> > {

51static int const value =

52sizeof(typename Array<T, N, RegisterSized>::Storage) * 8 * Array<T, N, RegisterSized>::kStorageElements;

53 };

54

56

58 CUTLASS_HOST_DEVICE

59 constexpr bool ispow2(unsigned x) {

60return !(x & (x - 1));

61 }

62

64

66 CUTLASS_HOST_DEVICE

67 constexpr unsigned floor_pow_2(unsigned x) {

68return ispow2(x) ? x : floor_pow_2(x >> 1);

69 }

70

72

74 template <

75typename T,

76int N

77 >

78 class Array<T, N, true> {

79 public:

80

82using Storage = T;

83

85using Element = T;

86

88//static std::size_t const kStorageElements = N;

89static size_t const kStorageElements = N;

90

92static size_t const kElements = N;

93

94//

95// C++ standard members

96//

97

98typedef T value_type;

99typedef size_t size_type;

100typedef ptrdiff_t difference_type;

101typedef value_type &reference;

102typedef value_type const & const_reference;

103typedef value_type *pointer;

104typedef value_type const * const_pointer;

105

106//

107// Iterators

108//

109

111class iterator {

112

114 T *ptr_;

115

116public:

117

118CUTLASS_HOST_DEVICE

119iterator(): ptr_(nullptr) { }

120

121CUTLASS_HOST_DEVICE

122iterator(T *_ptr): ptr_(_ptr) { }

123

124CUTLASS_HOST_DEVICE

125 iterator &operator++() {

126 ++ptr_;

127return *this;

128 }

129

130CUTLASS_HOST_DEVICE

131 iterator &operator--() {

132 --ptr_;

133return *this;

134 }

135

136CUTLASS_HOST_DEVICE

137 iterator operator++(int) {

138 iterator ret(*this);

139 ++ptr_;

140return ret;

141 }

142

143CUTLASS_HOST_DEVICE

144 iterator operator--(int) {

145 iterator ret(*this);

146 --ptr_;

147return ret;

148 }

149

150CUTLASS_HOST_DEVICE

151 T &operator*() const {

152return *ptr_;

153 }

154

155CUTLASS_HOST_DEVICE

156bool operator==(iterator const &other) const {

157return ptr_ == other.ptr_;

158 }

159

160CUTLASS_HOST_DEVICE

161bool operator!=(iterator const &other) const {

162return ptr_ != other.ptr_;

163 }

164 };

165

167class const_iterator {

168

170 T *ptr_;

171

172public:

173

174CUTLASS_HOST_DEVICE

175const_iterator(): ptr_(nullptr) { }

176

177CUTLASS_HOST_DEVICE

178const_iterator(T const *_ptr): ptr_(_ptr) { }

179

180CUTLASS_HOST_DEVICE

181 const_iterator &operator++() {

182 ++ptr_;

183return *this;

184 }

185

186CUTLASS_HOST_DEVICE

187 const_iterator &operator--() {

188 --ptr_;

189return *this;

190 }

191

192CUTLASS_HOST_DEVICE

193 const_iterator operator++(int) {

194 const_iterator ret(*this);

195 ++ptr_;

196return ret;

197 }

198

199CUTLASS_HOST_DEVICE

200 const_iterator operator--(int) {

201 const_iterator ret(*this);

202 --ptr_;

203return ret;

204 }

205

206CUTLASS_HOST_DEVICE

207 T const &operator*() const {

208return *ptr_;

209 }

210

211CUTLASS_HOST_DEVICE

212bool operator==(const_iterator const &other) const {

213return ptr_ == other.ptr_;

214 }

215

216CUTLASS_HOST_DEVICE

217bool operator!=(const_iterator const &other) const {

218return ptr_ != other.ptr_;

219 }

220 };

221

223class reverse_iterator {

224

226 T *ptr_;

227

228public:

229

230CUTLASS_HOST_DEVICE

231reverse_iterator(): ptr_(nullptr) { }

232

233CUTLASS_HOST_DEVICE

234reverse_iterator(T *_ptr): ptr_(_ptr) { }

235

236CUTLASS_HOST_DEVICE

237 reverse_iterator &operator++() {

238 --ptr_;

239return *this;

240 }

241

242CUTLASS_HOST_DEVICE

243 reverse_iterator &operator--() {

244 ++ptr_;

245return *this;

246 }

247

248CUTLASS_HOST_DEVICE

249 reverse_iterator operator++(int) {

250 iterator ret(*this);

251 --ptr_;

252return ret;

253 }

254

255CUTLASS_HOST_DEVICE

256 reverse_iterator operator--(int) {

257 iterator ret(*this);

258 ++ptr_;

259return ret;

260 }

261

262CUTLASS_HOST_DEVICE

263 T &operator*() const {

264return *(ptr_ - 1);

265 }

266

267CUTLASS_HOST_DEVICE

268bool operator==(reverse_iterator const &other) const {

269return ptr_ == other.ptr_;

270 }

271

272CUTLASS_HOST_DEVICE

273bool operator!=(reverse_iterator const &other) const {

274return ptr_ != other.ptr_;

275 }

276 };

277

[279](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html)class const_reverse_iterator {

280

282 T const *ptr_;

283

284public:

285

286CUTLASS_HOST_DEVICE

[287](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#aa839335a821fad9841eb31560d7520a2)[const_reverse_iterator](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#aa839335a821fad9841eb31560d7520a2)(): ptr_(nullptr) { }

288

289CUTLASS_HOST_DEVICE

[290](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#a6e2a9b7f836704d9d39ad42c74502a07)[const_reverse_iterator](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#a6e2a9b7f836704d9d39ad42c74502a07)(T const *_ptr): ptr_(_ptr) { }

291

292CUTLASS_HOST_DEVICE

[293](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#a76905b3d4bcb451ce2f6bdc73fa958ca) const_reverse_iterator &[operator++](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#a76905b3d4bcb451ce2f6bdc73fa958ca)() {

294 --ptr_;

295return *this;

296 }

297

298CUTLASS_HOST_DEVICE

[299](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#a16df2c0ef6340950eed8c080e18e062e) const_reverse_iterator &[operator--](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#a16df2c0ef6340950eed8c080e18e062e)() {

300 ++ptr_;

301return *this;

302 }

303

304CUTLASS_HOST_DEVICE

[305](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#a08821e8f1c7e5c614e38ac0b14787806) const_reverse_iterator [operator++](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#a08821e8f1c7e5c614e38ac0b14787806)(int) {

306 const_reverse_iterator ret(*this);

307 --ptr_;

308return ret;

309 }

310

311CUTLASS_HOST_DEVICE

[312](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#a9bbf80876fe3e72dbfe39ee880ec2f59) const_reverse_iterator [operator--](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#a9bbf80876fe3e72dbfe39ee880ec2f59)(int) {

313 const_reverse_iterator ret(*this);

314 ++ptr_;

315return ret;

316 }

317

318CUTLASS_HOST_DEVICE

[319](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#a49ed1c872c1640dca056fd4f8ced2261) T const &[operator*](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#a49ed1c872c1640dca056fd4f8ced2261)() const {

320return *(ptr_ - 1);

321 }

322

323CUTLASS_HOST_DEVICE

[324](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#af5f68e8bd235243c74e7dc256fa37408)bool [operator==](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#af5f68e8bd235243c74e7dc256fa37408)(const_iterator const &other) const {

325return ptr_ == other.ptr_;

326 }

327

328CUTLASS_HOST_DEVICE

[329](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#aec971b0beb331c02f2b6739bd78037dd)bool [operator!=](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#aec971b0beb331c02f2b6739bd78037dd)(const_iterator const &other) const {

330return ptr_ != other.ptr_;

331 }

332 };

333

334 private:

335

337Storage storage[kElements];

338

339 public:

340

341CUTLASS_HOST_DEVICE

342Array() { }

343

344CUTLASS_HOST_DEVICE

345Array(Array const &x) {

346CUTLASS_PRAGMA_UNROLL

347for (int i = 0; i < kElements; ++i) {

348 storage[i] = x.storage[i];

349 }

350 }

351

353CUTLASS_HOST_DEVICE

354void clear() {

355 fill(T(0));

356 }

357

358CUTLASS_HOST_DEVICE

359 reference at(size_type pos) {

360return reinterpret_cast<reference>(storage[pos]);

361 }

362

363CUTLASS_HOST_DEVICE

364 const_reference at(size_type pos) const {

365return reinterpret_cast<const_reference>(storage[pos]);

366 }

367

368CUTLASS_HOST_DEVICE

369 reference operator[](size_type pos) {

370return reinterpret_cast<reference>(storage[pos]);

371 }

372

373CUTLASS_HOST_DEVICE

374 const_reference operator[](size_type pos) const {

375return reinterpret_cast<const_reference>(storage[pos]);

376 }

377

378CUTLASS_HOST_DEVICE

379 reference front() {

380return reinterpret_cast<reference>(storage[0]);

381 }

382

383CUTLASS_HOST_DEVICE

384 const_reference front() const {

385return reinterpret_cast<const_reference>(storage[0]);

386 }

387

388CUTLASS_HOST_DEVICE

389 reference back() {

390return reinterpret_cast<reference>(storage[kStorageElements - 1]);

391 }

392

393CUTLASS_HOST_DEVICE

394 const_reference back() const {

395return reinterpret_cast<const_reference>(storage[kStorageElements - 1]);

396 }

397

398CUTLASS_HOST_DEVICE

399 pointer data() {

400return reinterpret_cast<pointer>(storage);

401 }

402

403CUTLASS_HOST_DEVICE

404 const_pointer data() const {

405return reinterpret_cast<const_pointer>(storage);

406 }

407

408CUTLASS_HOST_DEVICE

409 pointer raw_data() {

410return reinterpret_cast<pointer>(storage);

411 }

412

413CUTLASS_HOST_DEVICE

414 const_pointer raw_data() const {

415return reinterpret_cast<const_pointer>(storage);

416 }

417

418

419CUTLASS_HOST_DEVICE

420constexpr bool empty() const {

421return !kElements;

422 }

423

424CUTLASS_HOST_DEVICE

425constexpr size_type size() const {

426return kElements;

427 }

428

429CUTLASS_HOST_DEVICE

430constexpr size_type max_size() const {

431return kElements;

432 }

433

434CUTLASS_HOST_DEVICE

435void fill(T const &value) {

436CUTLASS_PRAGMA_UNROLL

437for (int i = 0; i < kElements; ++i) {

438 storage[i] = static_cast<Storage>(value);

439 }

440 }

441

442CUTLASS_HOST_DEVICE

443 iterator begin() {

444return iterator(storage);

445 }

446

447CUTLASS_HOST_DEVICE

448 const_iterator cbegin() const {

449return const_iterator(storage);

450 }

451

452CUTLASS_HOST_DEVICE

453 iterator end() {

454return iterator(reinterpret_cast<pointer>(storage + kStorageElements));

455 }

456

457CUTLASS_HOST_DEVICE

458 const_iterator cend() const {

459return const_iterator(reinterpret_cast<const_pointer>(storage + kStorageElements));

460 }

461

462CUTLASS_HOST_DEVICE

463 reverse_iterator rbegin() {

464return reverse_iterator(reinterpret_cast<pointer>(storage + kStorageElements));

465 }

466

467CUTLASS_HOST_DEVICE

468 const_reverse_iterator crbegin() const {

469return const_reverse_iterator(reinterpret_cast<const_pointer>(storage + kStorageElements));

470 }

471

472CUTLASS_HOST_DEVICE

473 reverse_iterator rend() {

474return reverse_iterator(reinterpret_cast<pointer>(storage));

475 }

476

477CUTLASS_HOST_DEVICE

478 const_reverse_iterator crend() const {

479return const_reverse_iterator(reinterpret_cast<const_pointer>(storage));

480 }

481

482//

483// Comparison operators

484//

485

486 };

487

489

490 } // namespace cutlass

491

493

494 #include "cutlass/array_subbyte.h"

495

497

498 namespace cutlass {

499

501

503 template <

505typename T,

507int N,

509int Alignment = sizeof_bits<T>::value * N / 8

510 >

511 class alignas(Alignment) AlignedArray: public Array<T, N> {

512 public:

513

514 };

515

517

518 } // namespace cutlass

519

521

cutlass::Array< T, N, true >::pointer

value_type * pointer

Definition: array.h:103

cutlass::Array< T, N, true >::iterator::operator!=

CUTLASS_HOST_DEVICE bool operator!=(iterator const &other) const

Definition: array.h:161

[cutlass::Array< T, N, true >::const_reverse_iterator::const_reverse_iterator](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#aa839335a821fad9841eb31560d7520a2)

CUTLASS_HOST_DEVICE const_reverse_iterator()

Definition: array.h:287

cutlass::Array< T, N, true >::const_iterator::const_iterator

CUTLASS_HOST_DEVICE const_iterator(T const *_ptr)

Definition: array.h:178

cutlass::Array< T, N, true >::const_iterator::const_iterator

CUTLASS_HOST_DEVICE const_iterator()

Definition: array.h:175

cutlass::Array< T, N, true >::empty

CUTLASS_HOST_DEVICE constexpr bool empty() const

Definition: array.h:420

cutlass::Array< T, N, true >::crbegin

CUTLASS_HOST_DEVICE const_reverse_iterator crbegin() const

Definition: array.h:468

cutlass::Array< T, N, true >::difference_type

ptrdiff_t difference_type

Definition: array.h:100

cutlass::Array< T, N, true >::reverse_iterator::operator--

CUTLASS_HOST_DEVICE reverse_iterator & operator--()

Definition: array.h:243

cutlass

Definition: aligned_buffer.h:35

constexpr

#define constexpr

Definition: platform.h:137

cutlass::sizeof_bits::value

static int const value

Definition: numeric_types.h:43

cutlass::Array< T, N, true >::const_iterator::operator++

CUTLASS_HOST_DEVICE const_iterator operator++(int)

Definition: array.h:193

cutlass::Array< T, N, true >::fill

CUTLASS_HOST_DEVICE void fill(T const &value)

Definition: array.h:435

array_subbyte.h

Statically sized array of elements that accommodates all CUTLASS-supported numeric types and is safe ...

cutlass::Array< T, N, true >::end

CUTLASS_HOST_DEVICE iterator end()

Definition: array.h:453

cutlass::Array< T, N, true >::data

CUTLASS_HOST_DEVICE pointer data()

Definition: array.h:399

cutlass::Array< T, N, true >::begin

CUTLASS_HOST_DEVICE iterator begin()

Definition: array.h:443

cutlass::Array< T, N, true >::rbegin

CUTLASS_HOST_DEVICE reverse_iterator rbegin()

Definition: array.h:463

cutlass::AlignedArray

Aligned array type.

Definition: array.h:511

cutlass::Array< T, N, true >::operator[]

CUTLASS_HOST_DEVICE const_reference operator[](size_type pos) const

Definition: array.h:374

cutlass::Array< T, N, true >::raw_data

CUTLASS_HOST_DEVICE pointer raw_data()

Definition: array.h:409

cutlass::Array< T, N, true >::rend

CUTLASS_HOST_DEVICE reverse_iterator rend()

Definition: array.h:473

cutlass::Array< T, N, true >::cend

CUTLASS_HOST_DEVICE const_iterator cend() const

Definition: array.h:458

[cutlass::Array< T, N, true >::const_reverse_iterator::const_reverse_iterator](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#a6e2a9b7f836704d9d39ad42c74502a07)

CUTLASS_HOST_DEVICE const_reverse_iterator(T const *_ptr)

Definition: array.h:290

cutlass::Array< T, N, true >::reverse_iterator::operator--

CUTLASS_HOST_DEVICE reverse_iterator operator--(int)

Definition: array.h:256

cutlass::Array< T, N, true >::size_type

size_t size_type

Definition: array.h:99

[cutlass::Array< T, N, true >::const_reverse_iterator::operator++](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#a76905b3d4bcb451ce2f6bdc73fa958ca)

CUTLASS_HOST_DEVICE const_reverse_iterator & operator++()

Definition: array.h:293

cutlass::Array< T, N, true >::size

CUTLASS_HOST_DEVICE constexpr size_type size() const

Definition: array.h:425

cutlass::Array< T, N, true >::back

CUTLASS_HOST_DEVICE reference back()

Definition: array.h:389

cutlass::Array< T, N, true >::reverse_iterator::operator!=

CUTLASS_HOST_DEVICE bool operator!=(reverse_iterator const &other) const

Definition: array.h:273

cutlass::Array< T, N, true >::reverse_iterator::operator++

CUTLASS_HOST_DEVICE reverse_iterator operator++(int)

Definition: array.h:249

cutlass::Array< T, N, true >::const_iterator::operator!=

CUTLASS_HOST_DEVICE bool operator!=(const_iterator const &other) const

Definition: array.h:217

[cutlass::Array< T, N, true >::const_reverse_iterator::operator!=](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#aec971b0beb331c02f2b6739bd78037dd)

CUTLASS_HOST_DEVICE bool operator!=(const_iterator const &other) const

Definition: array.h:329

CUTLASS_PRAGMA_UNROLL

#define CUTLASS_PRAGMA_UNROLL

Definition: cutlass.h:110

cutlass::Array< T, N, true >::const_reference

value_type const & const_reference

Definition: array.h:102

cutlass::Array< T, N, true >::reverse_iterator::operator++

CUTLASS_HOST_DEVICE reverse_iterator & operator++()

Definition: array.h:237

cutlass::Array< T, N, true >::const_iterator::operator*

CUTLASS_HOST_DEVICE T const & operator*() const

Definition: array.h:207

cutlass::Array< T, N, true >::reference

value_type & reference

Definition: array.h:101

cutlass::Array< T, N, true >::iterator::operator==

CUTLASS_HOST_DEVICE bool operator==(iterator const &other) const

Definition: array.h:156

cutlass::Array< T, N, true >::crend

CUTLASS_HOST_DEVICE const_reverse_iterator crend() const

Definition: array.h:478

cutlass::Array< T, N, true >::reverse_iterator::reverse_iterator

CUTLASS_HOST_DEVICE reverse_iterator()

Definition: array.h:231

cutlass::Array< T, N, true >::iterator::operator*

CUTLASS_HOST_DEVICE T & operator*() const

Definition: array.h:151

cutlass::sizeof_bits

Defines the size of an element in bits.

Definition: numeric_types.h:42

cutlass::Array< T, N, true >::iterator::operator++

CUTLASS_HOST_DEVICE iterator operator++(int)

Definition: array.h:137

cutlass::Array< T, N, true >::reverse_iterator::operator==

CUTLASS_HOST_DEVICE bool operator==(reverse_iterator const &other) const

Definition: array.h:268

nullptr

#define nullptr

nullptr

Definition: platform.h:144

cutlass::Array< T, N, true >::iterator::operator++

CUTLASS_HOST_DEVICE iterator & operator++()

Definition: array.h:125

cutlass::Array< T, N, true >::Storage

T Storage

Storage type.

Definition: array.h:82

cutlass::Array< T, N, true >::reverse_iterator::reverse_iterator

CUTLASS_HOST_DEVICE reverse_iterator(T *_ptr)

Definition: array.h:234

cutlass::Array< T, N, true >::iterator::iterator

CUTLASS_HOST_DEVICE iterator(T *_ptr)

Definition: array.h:122

cutlass::Array< T, N, true >::const_iterator::operator++

CUTLASS_HOST_DEVICE const_iterator & operator++()

Definition: array.h:181

cutlass::Array< T, N, true >::back

CUTLASS_HOST_DEVICE const_reference back() const

Definition: array.h:394

cutlass::Array< T, N, true >::iterator::operator--

CUTLASS_HOST_DEVICE iterator & operator--()

Definition: array.h:131

cutlass::Array< T, N, true >::at

CUTLASS_HOST_DEVICE const_reference at(size_type pos) const

Definition: array.h:364

CUTLASS_HOST_DEVICE

#define CUTLASS_HOST_DEVICE

Definition: cutlass.h:89

numeric_types.h

Top-level include for all CUTLASS numeric types.

cutlass::Array< T, N, true >::reverse_iterator::operator*

CUTLASS_HOST_DEVICE T & operator*() const

Definition: array.h:263

cutlass::Array< T, N, true >::const_iterator::operator==

CUTLASS_HOST_DEVICE bool operator==(const_iterator const &other) const

Definition: array.h:212

cutlass::Array< T, N, true >::front

CUTLASS_HOST_DEVICE reference front()

Definition: array.h:379

cutlass::Array< T, N, true >::Element

T Element

Element type.

Definition: array.h:85

cutlass::Array< T, N, true >::raw_data

CUTLASS_HOST_DEVICE const_pointer raw_data() const

Definition: array.h:414

cutlass::Array< T, N, true >::max_size

CUTLASS_HOST_DEVICE constexpr size_type max_size() const

Definition: array.h:430

cutlass::Array< T, N, true >::data

CUTLASS_HOST_DEVICE const_pointer data() const

Definition: array.h:404

[cutlass::Array< T, N, true >::const_reverse_iterator::operator==](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#af5f68e8bd235243c74e7dc256fa37408)

CUTLASS_HOST_DEVICE bool operator==(const_iterator const &other) const

Definition: array.h:324

cutlass::Array< T, N, true >::iterator::iterator

CUTLASS_HOST_DEVICE iterator()

Definition: array.h:119

cutlass::ispow2

CUTLASS_HOST_DEVICE constexpr bool ispow2(unsigned x)

Returns true if the argument is a power of 2.

Definition: array.h:59

cutlass::Array< T, N, true >::Array

CUTLASS_HOST_DEVICE Array(Array const &x)

Definition: array.h:345

cutlass::Array< T, N, true >::iterator::operator--

CUTLASS_HOST_DEVICE iterator operator--(int)

Definition: array.h:144

cutlass::floor_pow_2

CUTLASS_HOST_DEVICE constexpr unsigned floor_pow_2(unsigned x)

Returns the largest power of two not greater than the argument.

Definition: array.h:67

[cutlass::Array< T, N, true >::const_reverse_iterator::operator--](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#a9bbf80876fe3e72dbfe39ee880ec2f59)

CUTLASS_HOST_DEVICE const_reverse_iterator operator--(int)

Definition: array.h:312

cutlass::Array< T, N, true >::const_pointer

value_type const * const_pointer

Definition: array.h:104

[cutlass::Array< T, N, true >::const_reverse_iterator::operator--](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#a16df2c0ef6340950eed8c080e18e062e)

CUTLASS_HOST_DEVICE const_reverse_iterator & operator--()

Definition: array.h:299

cutlass::Array< T, N, true >::value_type

T value_type

Definition: array.h:98

cutlass::Array< T, N, true >::operator[]

CUTLASS_HOST_DEVICE reference operator[](size_type pos)

Definition: array.h:369

cutlass::Array< T, N, true >::cbegin

CUTLASS_HOST_DEVICE const_iterator cbegin() const

Definition: array.h:448

cutlass::Array< T, N, true >::Array

CUTLASS_HOST_DEVICE Array()

Definition: array.h:342

cutlass::Array< T, N, true >::const_iterator::operator--

CUTLASS_HOST_DEVICE const_iterator operator--(int)

Definition: array.h:200

[cutlass::Array< T, N, true >::const_reverse_iterator::operator++](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#a08821e8f1c7e5c614e38ac0b14787806)

CUTLASS_HOST_DEVICE const_reverse_iterator operator++(int)

Definition: array.h:305

cutlass.h

Basic include for CUTLASS.

[cutlass::Array< T, N, true >::const_reverse_iterator::operator*](classcutlass_1_1Array_3_01T_00_01N_00_01true_01_4_1_1const reverse iterator.html#a49ed1c872c1640dca056fd4f8ced2261)

CUTLASS_HOST_DEVICE T const & operator*() const

Definition: array.h:319

cutlass::Array< T, N, true >::front

CUTLASS_HOST_DEVICE const_reference front() const

Definition: array.h:384

cutlass::Array< T, N, true >::at

CUTLASS_HOST_DEVICE reference at(size_type pos)

Definition: array.h:359

cutlass::Array< T, N, true >::const_iterator::operator--

CUTLASS_HOST_DEVICE const_iterator & operator--()

Definition: array.h:187

cutlass::Array< T, N, true >::clear

CUTLASS_HOST_DEVICE void clear()

Efficient clear method.

Definition: array.h:354


Generated by 1.8.11