1

I am trying to use the ArrayFire library, everything is working perfectly (see the working example above), but I have a problem only when using a particular library af.lib. The problem is that when my program crashes, I have no message error and the compilation didn't send back any message either.

Reproducible Code and/or Steps (working)

  1. Add $(AF_PATH)/include; to Project Properties -> C/C++ -> General -> Additional Include Directories.
  2. Add $(AF_PATH)/lib; to Project Properties -> Linker -> General -> Additional Library Directories.
  3. Add afcpu.lib; to Project Properties -> Linker -> Input -> Additional Dependencies.

Here is the code used:

#include <iostream>
#include <arrayfire.h>

int main()
{
    std::cout << "Main running..." << std::endl;
    
    std::cout << "Available backends: " << af::getAvailableBackends() << std::endl;

   for (int i = 0; i <  af::getDeviceCount();  i++) {
        af::setDevice(i);
        af::info();
    }

    return 0;
}

Here is the output:

Main running...
Available backends: 1
ArrayFire v3.8.2 (CPU, 64-bit Windows, build 5752f2dc)
[0] Intel: Intel(R) Core(TM) i5-3337U CPU @ 1.80 GHz

Reproducible Code and/or Steps (not working)

  1. Add $(AF_PATH)/include; to Project Properties -> C/C++ -> General -> Additional Include Directories.
  2. Add $(AF_PATH)/lib; to Project Properties -> Linker -> General -> Additional Library Directories.
  3. Add af.lib; to Project Properties -> Linker -> Input -> Additional Dependencies.

Here is the code used:

#include <iostream>
#include <arrayfire.h>

int main()
{
    std::cout << "Main running..." << std::endl;

    try
    {
        std::cout << "Available backends: " << af::getAvailableBackends() << std::endl;
    }
    catch (af::exception& e)
    {
        std::cout << "Caught exception trying reading backends" << std::endl;
        std::cerr << e.what() << std::endl;
    }

    af::setBackend(AF_BACKEND_CPU);
    for (int i = 0; i <  af::getDeviceCount();  i++) {
        af::setDevice(i);
        af::info();
    }

    af::setBackend(AF_BACKEND_CUDA);
    for (int i = 0; i <  af::getDeviceCount();  i++) {
        af::setDevice(i);
        af::info();
    }

    af::setBackend(AF_BACKEND_OPENCL);
    for (int i = 0; i <  af::getDeviceCount();  i++) {
        af::setDevice(i);
        af::info();
    }

    return 0;
}

Here is the output:

Main running...

If I am running it with the Visual Studio Debugger, here is the error I obtain:

Unhandled exception at 0x00007FF90AEA4FD9 (KernelBase.dll) in main.exe : 0xC06D007F: Procedure not found (parameters : 0x000000D5546FD0F0).

Enabling the Microsoft or the NuGet Symbol Servers doesn't solve the error.

System Information

Windows 10 64 bits - Intel Core i5-3337U @ 1.80 GHz - Visual Studio Community 2019 16.11.11 - ArrayFire 3.8.2 (CUDA 11.4)

Visual Studio Configuration: Release, x64

Balfar
  • 125
  • 7
  • Could you please upload the library you use to Github and share it here if it's convenient for you? and what project did you create. – Yujian Yao - MSFT Jul 20 '22 at 07:51
  • Sure, I've added the GitHub at the beginning of my post. For the moment I am just trying to use it for experimentation, but at the end the objective is to make a parallelized ray tracing engine. – Balfar Jul 20 '22 at 07:56
  • "0xC06D007F: Procedure not found" could mean that there is a program or DLL that was built on one platform (or against one set of DLL dependencies) and is deployed on another platform (or with another set of DLL dependencies). – n. m. could be an AI Jul 20 '22 at 09:18
  • There doesn't seem to be a Lib folder in the link you shared, so I can't add the library to the project. – Yujian Yao - MSFT Jul 21 '22 at 09:30

0 Answers0