{"id":27200,"library":"onemkl-sycl-rng","title":"oneMKL SYCL RNG","description":"Intel® oneAPI Math Kernel Library (oneMKL) Random Number Generators (RNG) component for SYCL. Provides high-performance pseudorandom and quasi-random number generation on Intel GPUs and CPUs. Current version 2026.0.0. Released as part of the Intel oneAPI 2026.0 toolkit. Follows Intel's release cadence (yearly).","status":"active","version":"2026.0.0","language":"python","source_language":"en","source_url":"https://github.com/oneapi-src/oneMKL","tags":["oneMKL","random number generation","SYCL","Intel","GPU","high performance computing"],"install":[{"cmd":"pip install onemkl-sycl-rng","lang":"bash","label":"Install from PyPI"},{"cmd":"pip install onemkl-sycl-rng==2026.0.0","lang":"bash","label":"Install specific version"}],"dependencies":[],"imports":[{"wrong":"import onemkl._sycl_rng.rng as mkl_rng","symbol":"rng","correct":"import onemkl_sycl_rng"}],"quickstart":{"code":"import dpctl\nimport dpnp as np\nfrom onemkl._sycl_rng import rng as mkl_rng\n\n# Create a SYCL queue (e.g., GPU)\nqueue = dpctl.SyclQueue(\"gpu\")\n\n# Create an RNG engine and distribution\nengine = mkl_rng.create_engine(queue, mkl_rng.brng.mrg32k3a)\ndist = mkl_rng.create_distribution(mkl_rng.distribution.uniform, 0.0, 1.0)\n\n# Generate random numbers\nresult = np.empty(1000, dtype=np.float64)\nmkl_rng.generate(queue, engine, dist, result)\nprint(result[:5])\n","lang":"python","description":"Basic usage: create engine, create distribution, generate random numbers into a dpnp array."},"warnings":[{"fix":"Update import to: from onemkl._sycl_rng import rng as mkl_rng","message":"Top-level import path changed: use onemkl._sycl_rng.rng (not onemkl.sycl_rng.rng). The underscore prefix indicates private module – no stability guaranteed.","severity":"breaking","affected_versions":">=2025.0.0"},{"fix":"Replace mkl_random imports with onemkl._sycl_rng.rng and use dpnp arrays.","message":"The mkl_random module (from older mkl-random package) is deprecated. Use onemkl-sycl-rng for SYCL-based random number generation.","severity":"deprecated","affected_versions":"all"},{"fix":"Use dpnp.array(...) or dpctl.tensor.usm_ndarray to allocate memory.","message":"All data buffers must be dpnp arrays (or usm_ndarray). NumPy arrays are not supported and will cause runtime errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Create engine and distribution per queue.","message":"Engine and distribution objects must be re-created for each queue. Attempting to reuse an engine on a different device queue may cause silent failures.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'2026.0':43 '2026.0.0':35 'cadenc':49 'compon':14 'comput':60 'cpus':32 'current':33 'follow':45 'generat':12,27,54 'gpu':57 'gpus':30 'high':19,58 'high-perform':18 'intel':4,29,41,46,56 'kernel':7 'librari':8 'math':6 'number':11,26,53 'oneapi':5,42 'onemkl':1,9,51 'part':38 'perform':20,59 'provid':17 'pseudorandom':21 'quasi':24 'quasi-random':23 'random':10,25,52 'releas':36,48 'rng':3,13 'sycl':2,16,55 'toolkit':44 'version':34 'year':50","created_at":"2026-05-01T17:45:02.084346+00:00","updated_at":"2026-05-01T17:45:02.084346+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nModuleNotFoundError: No module named 'onemkl_sycl_rng'"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl.html","github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/onemkl-sycl-rng/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}