Code Monkey home page Code Monkey logo

Comments (3)

pfultz2 avatar pfultz2 commented on July 26, 2024

It looks like you are building the opencl backend and then using hip api with this which why this is broken. The cl_mem pointers and the device pointers from hip are not compatible. To build the hip backend, you need to set your compiler to hcc:

mkdir debug && cd debug
CXX=/opt/rocm/bin/hcc cmake -DCMAKE_BUILD_TYPE=Debug ../
make
sudo make install

You may need to also set the CMAKE_PREFIX_PATH as shown in the readme depending on how you installed hcc and hip: -DCMAKE_PREFIX_PATH="/opt/rocm/hcc;/opt/rocm/hip".

from miopen.

patflick avatar patflick commented on July 26, 2024

@pfultz2 Thank you! This is what was wrong.

Is there a way to detect that MIOpen was compiled differently then how it is used?

Looking into miopen/config.h:

#define MIOPEN_BACKEND_OPENCL 0
#define MIOPEN_BACKEND_HCC 0
#define MIOPEN_BACKEND_HIP 1

it looks like there are 3 possible backends at the moment. Are the HCC and HIP backends compatible?

So if I'm writing a hip based MIOpen application, I guess I could add something like the following:

#if MIOPEN_BACKEND_OPENCL
#error "The MIOpen OpenCL backend is not compatible with hip/hcc"
#endif

Is there a generic way you could detect the hip or hcc compiler in the MIOpen header and throw an error like this?

from miopen.

pfultz2 avatar pfultz2 commented on July 26, 2024

Are the HCC and HIP backends compatible?

The HCC backend is planned for the future, but it is not used.

So if I'm writing a hip based MIOpen application, I guess I could add something like the following:

That is one possible solution.

Is there a generic way you could detect the hip or hcc compiler in the MIOpen header and throw an error like this?

I dont think this is robust as we can compile our opencl backend using hcc. We could try to detect if a hip header has been included and then produce an error, but this only works when hip is included before miopen.

If you are using find_package(miopen PATHS /opt/rocm) in cmake using hcc, then you should always get an error about missing headers when the wrong backend is used.

from miopen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.