Skip to content

Commit

Permalink
[THC] Rename THCTensorMathMagma from cu to cpp (#58521)
Browse files Browse the repository at this point in the history
Summary:
This supposed to be a no-op (as .cu file do not contain any cuda code),
that reduces compilation time 2.5x:
```
$ time /usr/local/cuda/bin/nvcc /home/nshulga/git/pytorch/aten/src/THC/THCTensorMathMagma.cu -c ...
real	0m7.701s
$ time /usr/local/cuda/bin/nvcc /home/nshulga/git/pytorch/aten/src/THC/THCTensorMathMagma.cpp -c ...
real	0m2.657s
```

Pull Request resolved: #58521

Reviewed By: ngimel

Differential Revision: D28526946

Pulled By: malfet

fbshipit-source-id: ed42a9db3349654b75dcf63605bb4256154f01ff
  • Loading branch information
malfet authored and facebook-github-bot committed May 19, 2021
1 parent ae99640 commit 296d2a4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions aten/src/THC/CMakeLists.txt
Expand Up @@ -47,7 +47,7 @@ set(ATen_CUDA_SRCS ${ATen_CUDA_SRCS}
${CMAKE_CURRENT_SOURCE_DIR}/THCTensor.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCTensorCopy.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCTensorMath.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCTensorMathMagma.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCTensorMathMagma.cpp
${CMAKE_CURRENT_SOURCE_DIR}/THCTensorMathPairwise.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCTensorMathReduce.cu
${CMAKE_CURRENT_SOURCE_DIR}/THCTensorScatterGather.cu
Expand Down Expand Up @@ -101,7 +101,7 @@ install(FILES
THCTensorInfo.cuh
THCTensorMathPointwise.cuh
THCTensorTypeUtils.cuh
THCTensorMathMagma.cuh
THCTensorMathMagma.h
THCThrustAllocator.cuh
# See Note [TH abstraction violation]
THCTensor.hpp
Expand All @@ -124,7 +124,7 @@ install(FILES
generic/THCTensorMath.h
generic/THCTensorMath.cu
generic/THCTensorMathMagma.h
generic/THCTensorMathMagma.cu
generic/THCTensorMathMagma.cpp
generic/THCTensorMathPairwise.h
generic/THCTensorMathPairwise.cu
generic/THCTensorMathPointwise.h
Expand Down
@@ -1,7 +1,7 @@
#include <THC/THCGeneral.h>
#include <THC/THCTensorMath.h>
#include <THC/THCTensorCopy.h>
#include <THC/THCTensorMathMagma.cuh>
#include <THC/THCTensorMathMagma.h>
#include <THC/THCTensor.hpp>
#include <THC/THCStorage.hpp>
#include <algorithm>
Expand Down Expand Up @@ -32,5 +32,5 @@ struct Initializer {
} initializer;
} // anonymous namespace

#include <THC/generic/THCTensorMathMagma.cu>
#include <THC/generic/THCTensorMathMagma.cpp>
#include <THC/THCGenerateAllTypes.h>
File renamed without changes.
@@ -1,5 +1,5 @@
#ifndef THC_GENERIC_FILE
#define THC_GENERIC_FILE "THC/generic/THCTensorMathMagma.cu"
#define THC_GENERIC_FILE "THC/generic/THCTensorMathMagma.cpp"
#else

#include <c10/cuda/CUDAException.h>
Expand Down

0 comments on commit 296d2a4

Please sign in to comment.