Skip to content

Commit c9cc82f

Browse files
committed
Move the operation_mode enumeration to its own header
1 parent f2dea1e commit c9cc82f

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

dlib/cuda/cudnn_dlibapi.h

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
#ifndef DLIB_DNN_CuDNN_H_
44
#define DLIB_DNN_CuDNN_H_
55

6+
#include <memory>
7+
#include "operation_mode.h"
68
#ifdef DLIB_USE_CUDA
79
#include "cuda_errors.h"
8-
#include <memory>
910
#include "cuda_data_ptr.h"
1011
#endif // DLIB_USE_CUDA
1112

@@ -14,17 +15,6 @@ namespace dlib
1415
class tensor;
1516
class resizable_tensor;
1617

17-
// ----------------------------------------------------------------------------------------
18-
19-
/*!
20-
This enum is used to determine the mode of operation for certain functions
21-
(such as gemm and softmax) in Dlib. It specifies whether the calculation
22-
should be performed based on the matrix field in nr()xnc() or if the matrix
23-
should be considered in num_samples()xk(). This helps in organizing tensor
24-
computations more efficiently according to the required dimensions.
25-
!*/
26-
enum class operation_mode { CHANNEL_WISE = 0, PLANE_WISE = 1 };
27-
2818
#ifdef DLIB_USE_CUDA
2919
namespace cuda
3020
{

dlib/cuda/operation_mode.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (C) 2024 Davis E. King ([email protected])
2+
// License: Boost Software License See LICENSE.txt for the full license.
3+
#ifndef DLIB_CUDA_OPERATION_MODE_H
4+
#define DLIB_CUDA_OPERATION_MODE_H
5+
6+
namespace dlib
7+
{
8+
// ----------------------------------------------------------------------------------------
9+
10+
/*!
11+
This enum is used to determine the mode of operation for certain functions
12+
(such as gemm and softmax) in Dlib. It specifies whether the calculation
13+
should be performed based on the matrix field in nr()xnc() or if the matrix
14+
should be considered in num_samples()xk(). This helps in organizing tensor
15+
computations more efficiently according to the required dimensions.
16+
*/
17+
enum class operation_mode { CHANNEL_WISE = 0, PLANE_WISE = 1 };
18+
19+
// ----------------------------------------------------------------------------------------
20+
21+
} // namespace dlib
22+
23+
#endif // DLIB_CUDA_OPERATION_MODE_H

0 commit comments

Comments
 (0)