Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
faiss
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
faiss
Commits
df2edbe3
Commit
df2edbe3
authored
Jan 31, 2018
by
Matthijs Douze
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix issue 320
parent
4fe92046
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
BroadcastSum.cu
gpu/impl/BroadcastSum.cu
+4
-4
Tensor-inl.cuh
gpu/utils/Tensor-inl.cuh
+5
-0
No files found.
gpu/impl/BroadcastSum.cu
View file @
df2edbe3
...
...
@@ -47,7 +47,7 @@ __global__ void sumAlongColumns(Tensor<T, 1, true> input,
if (endRow) {
for (int row = rowStart; row < output.getSize(0); ++row) {
T out = output[row][col]
.ldg()
;
T out = output[row][col];
out = Math<T>::add(out, val);
output[row][col] = out;
}
...
...
@@ -57,7 +57,7 @@ __global__ void sumAlongColumns(Tensor<T, 1, true> input,
for (int row = rowStart; row < rowEnd; row += kRowUnroll) {
#pragma unroll
for (int i = 0; i < kRowUnroll; ++i) {
rows[i] = output[row + i][col]
.ldg()
;
rows[i] = output[row + i][col];
}
#pragma unroll
...
...
@@ -86,7 +86,7 @@ __global__ void sumAlongColumns(Tensor<T, 1, true> input,
for (int row = rowStart; row < output.getSize(0); ++row) {
#pragma unroll
for (int i = 0; i < kColLoad; ++i) {
T out = output[row][col + i * blockDim.x]
.ldg()
;
T out = output[row][col + i * blockDim.x];
out = Math<T>::add(out, val[i]);
output[row][col + i * blockDim.x] = out;
}
...
...
@@ -100,7 +100,7 @@ __global__ void sumAlongColumns(Tensor<T, 1, true> input,
#pragma unroll
for (int j = 0; j < kColLoad; ++j) {
rows[i * kColLoad + j] =
output[row + i][col + j * blockDim.x]
.ldg()
;
output[row + i][col + j * blockDim.x];
}
}
...
...
gpu/utils/Tensor-inl.cuh
View file @
df2edbe3
...
...
@@ -310,6 +310,11 @@ Tensor<T, Dim, InnerContig, IndexT, PtrTraits>::canCastResize() const {
static_assert(sizeof(U) >= sizeof(T), "only handles greater sizes");
constexpr int kMultiple = sizeof(U) / sizeof(T);
// Ensure that the base pointer is sizeof(U) aligned
if (((uintptr_t) data_) % sizeof(U) != 0) {
return false;
}
// Check all outer strides
for (int i = 0; i < Dim - 1; ++i) {
if (stride_[i] % kMultiple != 0) {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment