{"id":27199,"library":"onemkl-sycl-lapack","title":"oneMKL SYCL LAPACK","description":"Intel® oneAPI Math Kernel Library (oneMKL) SYCL LAPACK routines, providing dense and sparse linear algebra operations optimized for Intel CPUs and GPUs via SYCL. Current version 2026.0.0. Released as part of the Intel oneAPI toolkit with quarterly updates.","status":"active","version":"2026.0.0","language":"python","source_language":"en","source_url":"https://github.com/oneapi-src/oneMKL","tags":["oneapi","intel","mkl","lapack","sycl","gpu","linear-algebra"],"install":[{"cmd":"pip install onemkl-sycl-lapack","lang":"bash","label":"PyPI install (CPU/GPU with SYCL runtime)"}],"dependencies":[{"reason":"Array input/output compatibility","package":"numpy","optional":true},{"reason":"SYCL device management (required for GPU execution)","package":"dpctl","optional":true}],"imports":[{"note":"Top-level package onemkl_sycl_lapack does not contain LAPACK functions directly.","wrong":"import onemkl_sycl_lapack","symbol":"onemkl_lapack","correct":"import onemkl._onemkl_lapack"},{"note":"Incorrect module path.","wrong":"from onemkl_sycl_lapack import getrf","symbol":"getrf","correct":"from onemkl._onemkl_lapack import getrf"}],"quickstart":{"code":"import dpctl\nimport numpy as np\nfrom onemkl._onemkl_lapack import getrf\n\n# Create a SYCL queue on a GPU (or default device)\nqueue = dpctl.SyclQueue()\n\n# Allocate matrices as device arrays (dpctl.tensor)\na = np.array([[1., 2.], [3., 4.]], dtype=np.float64)\n# Convert to device memory\na_dev = dpctl.tensor.from_numpy(a, queue=queue)\n\n# Perform LU factorization (getrf)\n# Note: output arrays are modified in-place\nm = a_dev.shape[0]\nn = a_dev.shape[1]\npivots = dpctl.tensor.empty(m, dtype=np.int64, queue=queue)\n\n# The function signature: getrf(queue, m, n, a, lda, pivots)\ngetrf(queue, m, n, a_dev, m, pivots)\n\nprint(\"LU factorization completed on device.\")","lang":"python","description":"Basic LU factorization using onemkl SYCL LAPACK with dpctl for device memory and queue management."},"warnings":[{"fix":"Update calls: `getrf(m, n, a, lda, pivots)` -> `getrf(queue, m, n, a, lda, pivots)`","message":"All LAPACK routines now require a SYCL queue as the first argument. In older versions, the queue was optional or implicit.","severity":"breaking","affected_versions":"<=2025.x vs >=2026.0.0"},{"fix":"Change imports to `from onemkl._onemkl_lapack import ...`","message":"Direct import from `onemkl_sycl_lapack` is deprecated. Use `onemkl._onemkl_lapack` or higher-level wrapper.","severity":"deprecated","affected_versions":">=2026.0.0"},{"fix":"Use `dpctl.tensor.from_numpy(numpy_array, queue=queue)` to transfer data to device.","message":"Input arrays must be device-accessible (dpctl.tensor) not numpy arrays on host. Passing host memory may cause silent errors or segmentation faults.","severity":"gotcha","affected_versions":"all"},{"fix":"Call `dpctl.tensor.copy(input)` before passing to routine.","message":"The LAPACK routines modify input arrays in-place. Be sure to copy data if original is needed later.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install the package: `pip install onemkl-sycl-lapack` and import from `onemkl._onemkl_lapack`.","cause":"The top-level package name does not contain the LAPACK submodule directly.","error":"ModuleNotFoundError: No module named 'onemkl_sycl_lapack'"},{"fix":"Pass a valid dpctl.SyclQueue as first argument: `getrf(queue, m, n, a, lda, pivots)`.","cause":"SYCL queue argument is now mandatory as first parameter (breaking change in 2026.0).","error":"TypeError: getrf() missing 1 required positional argument: 'queue'"},{"fix":"Use `a.shape` directly on the dpctl tensor (it does support shape), or convert to numpy via `dpctl.tensor.asnumpy(a)`.","cause":"Mixing numpy and dpctl tensor operations incorrectly can lead to attribute errors.","error":"dpctl.tensor.usm_ndarray does not have attribute 'shape'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}