Skip to content

Commit

Permalink
Fix previous rebase
Browse files Browse the repository at this point in the history
Signed-off-by: Joaquin Anton <janton@nvidia.com>
  • Loading branch information
jantonguirao committed Nov 20, 2019
1 parent bbfa604 commit 45d5bb6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 35 deletions.
21 changes: 21 additions & 0 deletions cmake/Dependencies.common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,24 @@ include_directories(${PROJECT_SOURCE_DIR}/third_party/boost/preprocessor/include
# RapidJSON
##################################################################
include_directories(${PROJECT_SOURCE_DIR}/third_party/rapidjson/include)

##################################################################
# FFTS
##################################################################
if (BUILD_FFTS)
set(GENERATE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "-fPIC")
set(ENABLE_SHARED OFF CACHE BOOL "shared library target")
set(ENABLE_STATIC ON CACHE BOOL "static library target")

# Workaround for Clang as msse3 is only enabled if GCC is detected
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options("-msse")
add_compile_options("-msse2")
add_compile_options("-msse3")
endif()

check_and_add_cmake_submodule(${PROJECT_SOURCE_DIR}/third_party/ffts EXCLUDE_FROM_ALL)
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/third_party/ffts/include)
list(APPEND DALI_LIBS ffts)
list(APPEND DALI_EXCLUDES libffts.a)
endif()
4 changes: 3 additions & 1 deletion dali/kernels/signal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

add_subdirectory(fft)
if (BUILD_FFTS)
add_subdirectory(fft)
endif()

collect_headers(DALI_INST_HDRS PARENT_SCOPE)
collect_sources(DALI_KERNEL_SRCS PARENT_SCOPE)
Expand Down
1 change: 0 additions & 1 deletion dali/kernels/signal/fft/fft_cpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#include "dali/kernels/signal/fft/fft_cpu.h"
#include "dali/kernels/signal/fft/fft_cpu_impl_ffts.h"
#include <ffts/ffts.h>
#include <cmath>
#include <complex>
#include "dali/core/common.h"
Expand Down
33 changes: 0 additions & 33 deletions dali/kernels/signal/fft/fft_cpu_impl_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,39 +97,6 @@ void ForAxis(OutputType *out_ptr,
}
}

/**
* @brief iterator through all the 1-dimensional slices on a given axis
*/
template <typename OutputType, typename InputType, typename Functor>
void ForAxis(OutputType *out_ptr,
const InputType *in_ptr,
const int64_t *out_shape,
const int64_t *out_strides,
const int64_t *in_shape,
const int64_t *in_strides,
int axis,
int ndim,
Functor &&func,
int current_dim = 0) {
if (current_dim == ndim) {
func(out_ptr, in_ptr, out_shape[axis], out_strides[axis], in_shape[axis], in_strides[axis]);
return;
}

if (axis == current_dim) {
ForAxis(out_ptr, in_ptr, out_shape, out_strides, in_shape, in_strides,
axis, ndim, std::forward<Functor>(func), current_dim+1);
} else {
for (int i = 0; i < in_shape[current_dim]; i++) {
ForAxis(out_ptr + i * out_strides[current_dim],
in_ptr + i * in_strides[current_dim],
out_shape, out_strides,
in_shape, in_strides,
axis, ndim, std::forward<Functor>(func), current_dim+1);
}
}
}

} // namespace impl
} // namespace fft
} // namespace signal
Expand Down

0 comments on commit 45d5bb6

Please sign in to comment.