Skip to content

Commit ded39f8

Browse files
authored
[Cherrypick 2.1] fix compile error on jetson platform (#32760)
* fix compile error on jetson platform * remove unused head file * rm decode_jpeg op on jetson platform
1 parent 3ba8c48 commit ded39f8

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

cmake/operators.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ function(op_library TARGET)
4444
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${TARGET}.cu)
4545
list(APPEND cu_srcs ${TARGET}.cu)
4646
endif()
47+
if (WITH_NV_JETSON)
48+
list(REMOVE_ITEM cu_srcs "decode_jpeg_op.cu")
49+
endif()
4750
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${TARGET}.part.cu)
4851
set(PART_CUDA_KERNEL_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${TARGET}.part.cu
4952
${PART_CUDA_KERNEL_FILES} PARENT_SCOPE)

paddle/fluid/operators/decode_jpeg_op.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "paddle/fluid/framework/generator.h"
2020
#include "paddle/fluid/framework/op_registry.h"
2121
#include "paddle/fluid/framework/operator.h"
22-
#include "paddle/fluid/platform/dynload/nvjpeg.h"
2322
#include "paddle/fluid/platform/enforce.h"
2423

2524
namespace paddle {

paddle/fluid/operators/decode_jpeg_op.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef PADDLE_WITH_HIP
15+
#if !defined(WITH_NV_JETSON) && !defined(PADDLE_WITH_HIP)
1616

1717
#include <string>
1818
#include "paddle/fluid/framework/op_registry.h"

paddle/fluid/platform/dynload/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
cc_library(dynamic_loader SRCS dynamic_loader.cc DEPS glog gflags enforce)
22

3-
list(APPEND CUDA_SRCS cublas.cc cudnn.cc curand.cc cusolver.cc nvtx.cc nvjpeg.cc)
3+
list(APPEND CUDA_SRCS cublas.cc cudnn.cc curand.cc cusolver.cc nvtx.cc)
4+
5+
if (NOT WITH_NV_JETSON)
6+
list(APPEND CUDA_SRCS nvjpeg.cc)
7+
endif()
48

59
if (WITH_ROCM)
610
list(APPEND HIP_SRCS rocblas.cc miopen.cc hiprand.cc)

0 commit comments

Comments
 (0)