Skip to content

[Issue]: rocJPEG ctests seem to unintentionally test TurboJPEG instead #481

Description

@daniellegillai

Problem Description

The rocJPEG ctests found in tests/cpp_api/CMakeLists.txt (basic_test_rocjpeg_gray and basic_test_rocjpeg_rgb) pass in 2 as the ninth arg for tests/cpp_api/basic_test/basic_test.cpp. However, the usage describes the 9th arg as decoder_type <tjpeg: 0/rocjpeg:1>. In practice, basic_test.cpp will use rocJPEG if the arg is 1, and TurboJPEG otherwise. Therefore, by passing in 2, this test is actually testing TurboJPEG, not rocJPEG.

Relevant lines in basic_test.cpp:

65:   int decoder_type = 0;   // Set to default TurboJpeg decoder

86:   decoder_type = atoi(argv[argIdx++]);

90:    // Set the rocAL decoder type
91:   RocalDecoderType rocal_decoder_type = RocalDecoderType::ROCAL_DECODER_TJPEG;
92:   if (decoder_type == 1) {
93:        rocal_decoder_type = RocalDecoderType::ROCAL_DECODER_ROCJPEG;
94:       processing_device = 1;  // Requires GPU backend for rocJpeg decoder
95:   }

In CMakeLists.txt lines 243-253:

# 16 - basic_test_rocjpeg -- basic test with rocJpeg
if(rocjpeg_FOUND)
  add_test(NAME basic_test_rocjpeg_gray
            COMMAND basic_test 
            ${ROCM_PATH}/share/rocal/test/data/images/AMD-tinyDataSet ${ROCM_PATH}/share/rocal/test/data/images/AMD-tinyDataSet-val.txt 1 1 224 224 0 1 2
            WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/basic_test)
  add_test(NAME basic_test_rocjpeg_rgb
            COMMAND basic_test 
            ${ROCM_PATH}/share/rocal/test/data/images/AMD-tinyDataSet ${ROCM_PATH}/share/rocal/test/data/images/AMD-tinyDataSet-val.txt 1 1 224 224 1 1 2
            WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/basic_test)
endif()

Operating System

Ubuntu 24.04.4 LTS (Noble Numbat)

CPU

AMD Ryzen 9 9950X 16-Core Processor

GPU

AMD Radeon RX 9070 XT

ROCm Version

ROCm 7.13

ROCm Component

No response

Steps to Reproduce

Adding the following print statement to basic_test.cpp:

        decoded_output = rocalJpegFileSource(handle, folderPath1, color_format, decode_shard_counts, false, false, false,
                                             ROCAL_USE_USER_GIVEN_SIZE, decode_width, decode_height, rocal_decoder_type);
        std::cout << "Used rocal decoder type " << rocal_decoder_type << std::endl;       

yields the following line in the test log:
Used rocal decoder type 0.

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

rocminfo --support output
Paste output here

Additional Information

No response

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions