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

Segfault when trying to call MKL gemm #7

Open
ValouBambou opened this issue Mar 2, 2023 · 0 comments
Open

Segfault when trying to call MKL gemm #7

ValouBambou opened this issue Mar 2, 2023 · 0 comments

Comments

@ValouBambou
Copy link

ValouBambou commented Mar 2, 2023

When I tried to execute this simple program it segfaults in the MKL function, which does not happen when I do the same operation in C. So I'm confused, it also segfaults with dgemm.

extern crate cblas;
extern crate intel_mkl_src;

use cblas::*;

fn main() {
    let (m, n, k) = (1024, 1024, 1024);
    let a: Vec<f32> = (0..(m * k)).map(|i| i as f32).collect();
    let b: Vec<f32> = (0..(k * n)).map(|i| i as f32).collect();
    let mut c: Vec<f32> = (0..(m * n)).map(|_| 0.0).collect();
    unsafe {
        sgemm(
            Layout::RowMajor,
            Transpose::None,
            Transpose::None,
            m,
            n,
            k,
            1.0,
            &a,
            k,
            &b,
            n,
            0.0,
            &mut c,
            n,
        )
    }
}

My Cargo.toml file is containing only those dependencies which should work (both static and dynamic produces the segfault):

cblas = "0.4"
intel-mkl-src = {version = "0.8", features = ["mkl-dynamic-ilp64-seq"]}

Does anyone encounter this issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant