intel / DML

Intel® Data Mover Library (Intel® DML)
https://intel.github.io/DML/
MIT License
81 stars 17 forks source link

Job size seems too big #12

Closed kswiecicki closed 2 years ago

kswiecicki commented 2 years ago

Job size returned by dml_get_job_size(PATH, &job_size_ptr) function seems too big. I get the value '98816' regardless of the used path (DML_PATH_HW/DML_PATH_SW). Is ~100kB memory allocation for job buffer within the expected range?

EgorKupaev commented 2 years ago

Hi @kswiecicki,

what version of DML are you using? In the latest v0.1.5-beta the issue was fixed.

The exact code is:

constexpr auto get_job_size() noexcept
{
    constexpr auto alignment = 64u;
    constexpr auto job_size = sizeof(dml_job_t);
    constexpr auto state_size = sizeof(dml::state);

    // Enough size for job, state, and to align state to default boundary
    return job_size + state_size + alignment;
}

It's approximately 200 bytes of memory.

kswiecicki commented 2 years ago

I see, I've been using the DML built from develop branch ~3 weeks ago (v0.1.4-beta tag). I've just installed the DML from the v0.1.5-beta tag to check if the job size fix is working, but I get an awful lot of linker errors when building the source I previously linked the v0.1.4-beta version with. I didn't change anything in my build system, to double check I've restored the previous DML version and it's working properly. I've also made sure to link 'libdml.a' and not 'libdmlhl.a' by mistake.

DML build steps:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DDML_HW=ON -DLIB_ACCEL_3_2=ON ..
cmake --build . --target install

Could you take a look at the linker errors? dml_logs.txt

EgorKupaev commented 2 years ago

I've checked the issue. Release v0.1.5-beta unintentionally added C++ compiler dependency to C API.

I am looking for solution.

EgorKupaev commented 2 years ago

The issue was fixed in v0.1.6.0-beta.

I confirmed that there are no linker errors with a simple program. I used just C compiler for a build. Feel free to re-open the issue if it still can't be linked at your environment.