Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMAKE: add check for ZFP_CUDA #2937

Merged
merged 2 commits into from
Nov 2, 2021

Conversation

vicentebolea
Copy link
Collaborator

@vicentebolea vicentebolea commented Oct 29, 2021

In the previous PR #2920 which added among other things tests for ZFP with CUDA it does not check if the current ZFP installation supports ZFP.

For this purpose I added a PR at the ZFP which adds a parameter to see this (LLNL/zfp#147).

While this has been merged to keep compatibility to previous commits of ZFP I added some logic at our cmake code to figure out if we have ZFP_CUDA.

EDITED

I made some refactor at the compressZFP so that it moves out the include from the header to the implementation file, also I changed some of the defines provide from ZFP to more stable ones.

I also made the code compatible for ZFP 0.5.1 (the one that we publicly support) to 0.5.5 (latest).

@JasonRuonanWang
Copy link
Member

Hi I have got this error if my ZFP version is too old to support cuda. But cmake still thinks the ZFP version is okay. Will this PR solve this problem?

/home/w4g/d/a2/source/adios2/operator/compress/CompressZFP.cpp: In member function ‘zfp_stream* adios2::core::compress::CompressZFP::GetZFPStream(const Dims&, adios2::DataType, const Params&) const’:
/home/w4g/d/a2/source/adios2/operator/compress/CompressZFP.cpp:287:22: error: ‘zfp_exec_cuda’ was not declared in this scope
policy = zfp_exec_cuda;
^~~~~~~~~~~~~
/home/w4g/d/a2/source/adios2/operator/compress/CompressZFP.cpp:287:22: note: suggested alternative: ‘zfp_exec_omp’
policy = zfp_exec_cuda;
^~~~~~~~~~~~~
zfp_exec_omp

@vicentebolea
Copy link
Collaborator Author

Hi I have got this error if my ZFP version is too old to support cuda. But cmake still thinks the ZFP version is okay. Will this PR solve this problem?

/home/w4g/d/a2/source/adios2/operator/compress/CompressZFP.cpp: In member function ‘zfp_stream* adios2::core::compress::CompressZFP::GetZFPStream(const Dims&, adios2::DataType, const Params&) const’: /home/w4g/d/a2/source/adios2/operator/compress/CompressZFP.cpp:287:22: error: ‘zfp_exec_cuda’ was not declared in this scope policy = zfp_exec_cuda; ^~~~~~~~~~~~~ /home/w4g/d/a2/source/adios2/operator/compress/CompressZFP.cpp:287:22: note: suggested alternative: ‘zfp_exec_omp’ policy = zfp_exec_cuda; ^~~~~~~~~~~~~ zfp_exec_omp

Yeah this PR attempts to solve this, but now that I see it it needs a bit more work

@vicentebolea
Copy link
Collaborator Author

@JasonRuonanWang could you point me to which version of ZFP are you using?

endif()

if(ADIOS2_HAVE_ZFP_CUDA)
add_compile_definitions(ADIOS2_HAVE_ZFP_CUDA)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chuckatkins is it ok to add defines like this in ADIOS?

@JasonRuonanWang
Copy link
Member

JasonRuonanWang commented Oct 29, 2021

@JasonRuonanWang could you point me to which version of ZFP are you using?

I actually don't know. I had this error and then I realized that it was probably a version issue, and then I just upgraded my ZFP installation and then it worked. So... haven't kept any info of the old installation. Sorry.

It should be pretty easy to check the ZFP source code though. Just start from the newest version and check backward, until you see there is no zfp_exec_cuda defined in the enum, then that's the version cmake should say no to.

@vicentebolea
Copy link
Collaborator Author

@JasonRuonanWang find many changes here, I tested it for 0.5.1 to 0.5.5 and everything is good, I guess you have to take my word here until we have the CI build to test this. There is also a bit of refactor hereto encapsulate the dependencies a bit better.

@JasonRuonanWang
Copy link
Member

@vicentebolea I can live with this. I am fine as long as it compiles and allows me to work on the operators.

@JasonRuonanWang
Copy link
Member

@vicentebolea Is this good to go?

@vicentebolea
Copy link
Collaborator Author

@JasonRuonanWang yes

@JasonRuonanWang JasonRuonanWang merged commit 44a032c into ornladios:master Nov 2, 2021
@vicentebolea vicentebolea deleted the add-zfp-cuda-test branch November 2, 2021 17:03
@vicentebolea vicentebolea added the api:CUDA CUDA API related label Dec 21, 2021
@vicentebolea vicentebolea self-assigned this Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api:CUDA CUDA API related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants