-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
57 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright (c) 2023 Graphcore Ltd. All rights reserved. | ||
#include "tile_small_dot.hpp" | ||
|
||
#include <poplar/HalfFloat.hpp> | ||
#include <poplar/Vertex.hpp> | ||
|
||
// class [[poplar::constraint("elem(*x) != elem(*y)")]] DotProduct1dVertex | ||
// : public MultiVertex { | ||
class Rotation2dVertex : public MultiVertex { | ||
public: | ||
using T = float; | ||
using T2 = float2; | ||
// Using `uint16` seems to be generating more efficient loops? | ||
using IndexType = unsigned short; | ||
|
||
static constexpr size_t MIN_ALIGN = 8; | ||
|
||
Input<Vector<T, poplar::VectorLayout::ONE_PTR, MIN_ALIGN>> | ||
inrow0; // (N,) first input row vector | ||
Input<Vector<T, poplar::VectorLayout::ONE_PTR, MIN_ALIGN>> | ||
inrow1; // (N,) second input row vector | ||
|
||
Input<Vector<T, poplar::VectorLayout::ONE_PTR>> | ||
cs; // (2,) rotation cosinus/sinus values | ||
|
||
Input<Vector<IndexType, poplar::VectorLayout::ONE_PTR>> | ||
worker_offsets; // (7,) number threads + 1. | ||
|
||
Output<Vector<T, poplar::VectorLayout::ONE_PTR>> | ||
outrow0; // (N,) first input row vector | ||
Output<Vector<T, poplar::VectorLayout::ONE_PTR>> | ||
outrow1; // (N,) first input row vector | ||
|
||
bool compute(unsigned wid) { | ||
// Always assuming size % 2 == 0 | ||
const IndexType wstart = worker_offsets[wid]; | ||
const IndexType wend = worker_offsets[wid + 1]; | ||
const IndexType wsize = wend - wstart; | ||
|
||
|
||
return true; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright (c) 2023 Graphcore Ltd. All rights reserved. | ||
// #include <poplar/HalfFloat.hpp> | ||
// #include <poplar/Vertex.hpp> | ||
|
||
#include "intrinsics_utils.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters