如何确定DPC++编译器是否与intel MKL兼容?

问题描述 投票:0回答:1

我尝试使用英特尔 MKL 和 DPC++ 编译器,并报告

“test_parallel.exe 中 0x00007FF61B91397A 处出现未处理的异常: 0xC0000005:读取位置 0x000002239F286444 时访问冲突。”

下面是我测试MKL功能的代码:

int main()
{
    //cl::sycl::stream cout(1024, 256);
    int a = 1, b = 1;
    int n = 5;
    float* A = (float*)mkl_malloc(n * 1 * sizeof(float), 64);
    float* B = (float*)mkl_malloc(n * 1 * sizeof(float), 64);
    printf("The 1st vector is ");
    for (int i = 0; i < n; i++) {
        A[i] = i;
        printf("%2.0f", A[i]);
    }
    printf("\n");
    printf("The 2st vector is ");
    for (int i = 0; i < n; i++) {
        B[i] = i + 1;
        printf("%2.0f", B[i]);
    }
    printf("\n");
    //compute:a*A+b*B
    cblas_saxpby(n, a, A, 1, b, B, 1);
    printf("The a*A+b*B is ");
    for(int i = 0; i < n; i++) //this is where the above error is reported
    {
        printf("%2.0f", B[i]);
    }
    printf("\n");
    mkl_free(A);
    mkl_free(B);
    //getchar();
    return 0;
}

当我使用Intel C++编译器时,上面的代码可以工作,并且我确信intel DPC++编译器已正确安装,因为我之前测试过向量相加程序。

我想知道 DPC++ 编译器是否可以与 Intel MKL 一起使用。

c++ intel-mkl dpc++
1个回答
0
投票

我在Intel论坛问过这个问题,版主解决了这个问题。

问题是由我的项目属性设置引起的:我使用了 DPC++ API 而不是“ILP64”接口,这导致出现问题。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.