Skip to content

Commit

Permalink
Moving operators around. (#1667)
Browse files Browse the repository at this point in the history
Improve operator grouping in directory structure.

Signed-off-by: Michal Zientkiewicz <[email protected]>
  • Loading branch information
mzient authored Jan 16, 2020
1 parent f41be9b commit 5b9f9d7
Show file tree
Hide file tree
Showing 251 changed files with 600 additions and 560 deletions.
36 changes: 18 additions & 18 deletions cmake/lint.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@ list(REMOVE_ITEM LINT_INC

# cuTT
list(REMOVE_ITEM LINT_SRC
${DALI_SRC_DIR}/operators/transpose/cutt/cutt.h
${DALI_SRC_DIR}/operators/transpose/cutt/cutt.cc
${DALI_SRC_DIR}/operators/transpose/cutt/cuttplan.h
${DALI_SRC_DIR}/operators/transpose/cutt/cuttplan.cc
${DALI_SRC_DIR}/operators/transpose/cutt/cuttkernel.cu
${DALI_SRC_DIR}/operators/transpose/cutt/cuttkernel.h
${DALI_SRC_DIR}/operators/transpose/cutt/calls.h
${DALI_SRC_DIR}/operators/transpose/cutt/cuttGpuModel.h
${DALI_SRC_DIR}/operators/transpose/cutt/cuttGpuModel.cc
${DALI_SRC_DIR}/operators/transpose/cutt/cuttGpuModelKernel.h
${DALI_SRC_DIR}/operators/transpose/cutt/cuttGpuModelKernel.cu
${DALI_SRC_DIR}/operators/transpose/cutt/CudaMemcpy.h
${DALI_SRC_DIR}/operators/transpose/cutt/CudaMemcpy.cu
${DALI_SRC_DIR}/operators/transpose/cutt/CudaUtils.h
${DALI_SRC_DIR}/operators/transpose/cutt/CudaUtils.cu
${DALI_SRC_DIR}/operators/transpose/cutt/cuttTypes.h
${DALI_SRC_DIR}/operators/transpose/cutt/int_vector.h
${DALI_SRC_DIR}/operators/transpose/cutt/LRUCache.h
${DALI_SRC_DIR}/operators/generic/transpose/cutt/cutt.h
${DALI_SRC_DIR}/operators/generic/transpose/cutt/cutt.cc
${DALI_SRC_DIR}/operators/generic/transpose/cutt/cuttplan.h
${DALI_SRC_DIR}/operators/generic/transpose/cutt/cuttplan.cc
${DALI_SRC_DIR}/operators/generic/transpose/cutt/cuttkernel.cu
${DALI_SRC_DIR}/operators/generic/transpose/cutt/cuttkernel.h
${DALI_SRC_DIR}/operators/generic/transpose/cutt/calls.h
${DALI_SRC_DIR}/operators/generic/transpose/cutt/cuttGpuModel.h
${DALI_SRC_DIR}/operators/generic/transpose/cutt/cuttGpuModel.cc
${DALI_SRC_DIR}/operators/generic/transpose/cutt/cuttGpuModelKernel.h
${DALI_SRC_DIR}/operators/generic/transpose/cutt/cuttGpuModelKernel.cu
${DALI_SRC_DIR}/operators/generic/transpose/cutt/CudaMemcpy.h
${DALI_SRC_DIR}/operators/generic/transpose/cutt/CudaMemcpy.cu
${DALI_SRC_DIR}/operators/generic/transpose/cutt/CudaUtils.h
${DALI_SRC_DIR}/operators/generic/transpose/cutt/CudaUtils.cu
${DALI_SRC_DIR}/operators/generic/transpose/cutt/cuttTypes.h
${DALI_SRC_DIR}/operators/generic/transpose/cutt/int_vector.h
${DALI_SRC_DIR}/operators/generic/transpose/cutt/LRUCache.h
)

set(LINT_TARGET lint)
Expand Down
6 changes: 3 additions & 3 deletions dali/benchmark/displacement_cpu_bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#include <benchmark/benchmark.h>

#include "dali/benchmark/dali_bench.h"
#include "dali/operators/displacement/displacement_filter_impl_cpu.h"
#include "dali/operators/displacement/sphere.h"
#include "dali/operators/displacement/water.h"
#include "dali/operators/image/remap/displacement_filter_impl_cpu.h"
#include "dali/operators/image/remap/sphere.h"
#include "dali/operators/image/remap/water.h"
#include "dali/pipeline/data/tensor.h"
#include "dali/pipeline/pipeline.h"
#include "dali/util/image.h"
Expand Down
24 changes: 7 additions & 17 deletions dali/operators/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,17 @@
project(dali_operator)

add_subdirectory(audio)
add_subdirectory(color)
add_subdirectory(color_space)
add_subdirectory(crop)
add_subdirectory(bbox)
add_subdirectory(debug)
add_subdirectory(decoder)
add_subdirectory(detection)
add_subdirectory(displacement)
add_subdirectory(erase)
add_subdirectory(expressions)
add_subdirectory(fused)
add_subdirectory(geometric)
if (BUILD_NVOF)
add_subdirectory(optical_flow)
endif()
add_subdirectory(paste)
add_subdirectory(generic)
add_subdirectory(image)
add_subdirectory(math)
add_subdirectory(random)
add_subdirectory(reader)
add_subdirectory(resize)
add_subdirectory(sequence)
add_subdirectory(signal)
add_subdirectory(support)
add_subdirectory(transpose)
add_subdirectory(util)
add_subdirectory(ssd)
if (BUILD_PYTHON)
add_subdirectory(python_function)
endif()
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "dali/operators/geometric/bb_flip.h"
#include "dali/operators/bbox/bb_flip.h"
#include <dali/pipeline/util/bounding_box.h>
#include <iterator>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <dali/operators/geometric/bb_flip.cuh>
#include <dali/operators/bbox/bb_flip.cuh>
#include <dali/pipeline/operator/arg_helper.h>
#include <vector>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef DALI_OPERATORS_GEOMETRIC_BB_FLIP_CUH_
#define DALI_OPERATORS_GEOMETRIC_BB_FLIP_CUH_
#ifndef DALI_OPERATORS_BBOX_BB_FLIP_CUH_
#define DALI_OPERATORS_BBOX_BB_FLIP_CUH_

#include <vector>

#include "dali/operators/geometric/bb_flip.h"
#include "dali/operators/bbox/bb_flip.h"

namespace dali {

Expand All @@ -36,4 +36,4 @@ class BbFlip<GPUBackend> : public Operator<GPUBackend> {

} // namespace dali

#endif // DALI_OPERATORS_GEOMETRIC_BB_FLIP_CUH_
#endif // DALI_OPERATORS_BBOX_BB_FLIP_CUH_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef DALI_OPERATORS_GEOMETRIC_BB_FLIP_H_
#define DALI_OPERATORS_GEOMETRIC_BB_FLIP_H_
#ifndef DALI_OPERATORS_BBOX_BB_FLIP_H_
#define DALI_OPERATORS_BBOX_BB_FLIP_H_

#include <string>
#include <vector>
Expand Down Expand Up @@ -92,4 +92,4 @@ class BbFlip<CPUBackend> : public Operator<CPUBackend> {

} // namespace dali

#endif // DALI_OPERATORS_GEOMETRIC_BB_FLIP_H_
#endif // DALI_OPERATORS_BBOX_BB_FLIP_H_
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <cmath>

#include "dali/operators/paste/bbox_paste.h"
#include "dali/operators/bbox/bbox_paste.h"

namespace dali {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef DALI_OPERATORS_PASTE_BBOX_PASTE_H_
#define DALI_OPERATORS_PASTE_BBOX_PASTE_H_
#ifndef DALI_OPERATORS_BBOX_BBOX_PASTE_H_
#define DALI_OPERATORS_BBOX_BBOX_PASTE_H_

#include <vector>

Expand Down Expand Up @@ -47,4 +47,4 @@ class BBoxPaste : public Operator<Backend> {

} // namespace dali

#endif // DALI_OPERATORS_PASTE_BBOX_PASTE_H_
#endif // DALI_OPERATORS_BBOX_BBOX_PASTE_H_
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "dali/operators/util/dump_image.h"
#include "dali/operators/debug/dump_image.h"
#include "dali/util/image.h"

namespace dali {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "dali/operators/util/dump_image.h"
#include "dali/operators/debug/dump_image.h"
#include "dali/util/image.h"

namespace dali {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef DALI_OPERATORS_UTIL_DUMP_IMAGE_H_
#define DALI_OPERATORS_UTIL_DUMP_IMAGE_H_
#ifndef DALI_OPERATORS_DEBUG_DUMP_IMAGE_H_
#define DALI_OPERATORS_DEBUG_DUMP_IMAGE_H_

#include <string>
#include <vector>
Expand Down Expand Up @@ -47,4 +47,4 @@ class DumpImage : public Operator<Backend> {
};
} // namespace dali

#endif // DALI_OPERATORS_UTIL_DUMP_IMAGE_H_
#endif // DALI_OPERATORS_DEBUG_DUMP_IMAGE_H_
2 changes: 1 addition & 1 deletion dali/operators/decoder/host/fused/host_decoder_crop.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <vector>
#include "dali/core/common.h"
#include "dali/operators/crop/crop_attr.h"
#include "dali/operators/image/crop/crop_attr.h"
#include "dali/operators/decoder/host/host_decoder.h"

namespace dali {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define DALI_OPERATORS_DECODER_HOST_FUSED_HOST_DECODER_RANDOM_CROP_H_

#include "dali/core/common.h"
#include "dali/operators/crop/random_crop_attr.h"
#include "dali/operators/image/crop/random_crop_attr.h"
#include "dali/operators/decoder/host/host_decoder.h"

namespace dali {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

#include "dali/operators/decoder/decoder_test.h"
#include "dali/operators/crop/random_crop_attr.h"
#include "dali/operators/image/crop/random_crop_attr.h"

namespace dali {

Expand Down
2 changes: 1 addition & 1 deletion dali/operators/decoder/host/fused/host_decoder_slice.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <vector>
#include "dali/core/common.h"
#include "dali/operators/crop/slice_attr.h"
#include "dali/operators/generic/slice/slice_attr.h"
#include "dali/operators/decoder/host/host_decoder.h"

namespace dali {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <vector>
#include "dali/operators/decoder/nvjpeg/decoupled_api/nvjpeg_decoder_cpu.h"
#include "dali/operators/crop/crop_attr.h"
#include "dali/operators/image/crop/crop_attr.h"

namespace dali {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define DALI_OPERATORS_DECODER_NVJPEG_DECOUPLED_API_FUSED_NVJPEG_DECODER_CPU_RANDOM_CROP_H_

#include "dali/operators/decoder/nvjpeg/decoupled_api/nvjpeg_decoder_cpu.h"
#include "dali/operators/crop/random_crop_attr.h"
#include "dali/operators/image/crop/random_crop_attr.h"

namespace dali {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <vector>
#include "dali/operators/decoder/nvjpeg/decoupled_api/nvjpeg_decoder_cpu.h"
#include "dali/operators/crop/slice_attr.h"
#include "dali/operators/generic/slice/slice_attr.h"

namespace dali {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <vector>
#include "dali/operators/decoder/nvjpeg/decoupled_api/nvjpeg_decoder_decoupled_api.h"
#include "dali/operators/crop/crop_attr.h"
#include "dali/operators/image/crop/crop_attr.h"

namespace dali {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define DALI_OPERATORS_DECODER_NVJPEG_DECOUPLED_API_FUSED_NVJPEG_DECODER_RANDOM_CROP_H_

#include "dali/operators/decoder/nvjpeg/decoupled_api/nvjpeg_decoder_decoupled_api.h"
#include "dali/operators/crop/random_crop_attr.h"
#include "dali/operators/image/crop/random_crop_attr.h"

namespace dali {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

#include "dali/operators/decoder/decoder_test.h"
#include "dali/operators/crop/random_crop_attr.h"
#include "dali/operators/image/crop/random_crop_attr.h"

namespace dali {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <vector>
#include "dali/operators/decoder/nvjpeg/decoupled_api/nvjpeg_decoder_decoupled_api.h"
#include "dali/operators/crop/slice_attr.h"
#include "dali/operators/generic/slice/slice_attr.h"

namespace dali {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

#include "dali/operators/decoder/decoder_test.h"
#include "dali/operators/crop/random_crop_attr.h"
#include "dali/operators/image/crop/random_crop_attr.h"

namespace dali {

Expand Down
23 changes: 23 additions & 0 deletions dali/operators/generic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Get all the source files and dump test files

add_subdirectory(erase)
add_subdirectory(slice)
add_subdirectory(transpose)

collect_headers(DALI_INST_HDRS PARENT_SCOPE)
collect_sources(DALI_OPERATOR_SRCS PARENT_SCOPE)
collect_test_sources(DALI_OPERATOR_TEST_SRCS PARENT_SCOPE)
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


#include "dali/core/static_switch.h"
#include "dali/operators/util/cast.h"
#include "dali/operators/generic/cast.h"

namespace dali {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "dali/core/cuda_utils.h"
#include "dali/core/error_handling.h"
#include "dali/core/static_switch.h"
#include "dali/operators/util/cast.h"
#include "dali/operators/generic/cast.h"

namespace dali {

Expand Down
6 changes: 3 additions & 3 deletions dali/operators/util/cast.h → dali/operators/generic/cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef DALI_OPERATORS_UTIL_CAST_H_
#define DALI_OPERATORS_UTIL_CAST_H_
#ifndef DALI_OPERATORS_GENERIC_CAST_H_
#define DALI_OPERATORS_GENERIC_CAST_H_

#include <vector>

Expand Down Expand Up @@ -62,4 +62,4 @@ class Cast : public Operator<Backend> {

} // namespace dali

#endif // DALI_OPERATORS_UTIL_CAST_H_
#endif // DALI_OPERATORS_GENERIC_CAST_H_
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "dali/operators/erase/erase.h"
#include "dali/operators/generic/erase/erase.h"
#include <memory>
#include "dali/operators/erase/erase_utils.h"
#include "dali/operators/generic/erase/erase_utils.h"
#include "dali/core/static_switch.h"
#include "dali/pipeline/data/views.h"
#include "dali/kernels/erase/erase_cpu.h"
Expand Down
Loading

0 comments on commit 5b9f9d7

Please sign in to comment.