Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .githash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
321fb12e0f01f8fb792cb0a49ff877bb6502ad7d
d2cad4e9f92ba5a786fd167f585882eb109fbb3d
3 changes: 2 additions & 1 deletion lib/cunumeric_jl_wrapper/include/accessors.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2025 Northwestern University,
/* Copyright 2026 Northwestern University,
* Carnegie Mellon University University
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,6 +15,7 @@
*
* Author(s): David Krasowska <krasow@u.northwestern.edu>
* Ethan Meitz <emeitz@andrew.cmu.edu>
* Nader Rahhal <naderrahhal2026@u.northwestern.edu>
*/

#pragma once
Expand Down
20 changes: 20 additions & 0 deletions lib/cunumeric_jl_wrapper/include/ndarray_c_api.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/* Copyright 2026 Northwestern University,
* Carnegie Mellon University University
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Author(s): David Krasowska <krasow@u.northwestern.edu>
* Ethan Meitz <emeitz@andrew.cmu.edu>
* Nader Rahhal <naderrahhal2026@u.northwestern.edu>
*/

#ifndef NDARRAY_C_API_H
#define NDARRAY_C_API_H

Expand Down
3 changes: 2 additions & 1 deletion lib/cunumeric_jl_wrapper/include/types.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2025 Northwestern University,
/* Copyright 2026 Northwestern University,
* Carnegie Mellon University University
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,6 +15,7 @@
*
* Author(s): David Krasowska <krasow@u.northwestern.edu>
* Ethan Meitz <emeitz@andrew.cmu.edu>
* Nader Rahhal <naderrahhal2026@u.northwestern.edu>
*/

#pragma once
Expand Down
3 changes: 2 additions & 1 deletion lib/cunumeric_jl_wrapper/include/ufi.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2025 Northwestern University,
/* Copyright 2026 Northwestern University,
* Carnegie Mellon University University
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,6 +15,7 @@
*
* Author(s): David Krasowska <krasow@u.northwestern.edu>
* Ethan Meitz <emeitz@andrew.cmu.edu>
* Nader Rahhal <naderrahhal2026@u.northwestern.edu>
*/

#pragma once
Expand Down
3 changes: 2 additions & 1 deletion lib/cunumeric_jl_wrapper/src/cuda.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2025 Northwestern University,
/* Copyright 2026 Northwestern University,
* Carnegie Mellon University University
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,6 +15,7 @@
*
* Author(s): David Krasowska <krasow@u.northwestern.edu>
* Ethan Meitz <emeitz@andrew.cmu.edu>
* Nader Rahhal <naderrahhal2026@u.northwestern.edu>
*/

#include "cuda.h"
Expand Down
20 changes: 20 additions & 0 deletions lib/cunumeric_jl_wrapper/src/memory.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/* Copyright 2026 Northwestern University,
* Carnegie Mellon University University
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Author(s): David Krasowska <krasow@u.northwestern.edu>
* Ethan Meitz <emeitz@andrew.cmu.edu>
* Nader Rahhal <naderrahhal2026@u.northwestern.edu>
*/

#include <cupynumeric.h>
#include <cupynumeric/runtime.h>
#include <deps/realm/machine.h>
Expand Down
20 changes: 20 additions & 0 deletions lib/cunumeric_jl_wrapper/src/ndarray.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/* Copyright 2026 Northwestern University,
* Carnegie Mellon University University
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Author(s): David Krasowska <krasow@u.northwestern.edu>
* Ethan Meitz <emeitz@andrew.cmu.edu>
* Nader Rahhal <naderrahhal2026@u.northwestern.edu>
*/

#include <cupynumeric.h>
#include <cupynumeric/ndarray.h>
#include <cupynumeric/operators.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/cunumeric_jl_wrapper/src/types.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2025 Northwestern University,
/* Copyright 2026 Northwestern University,
* Carnegie Mellon University University
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
10 changes: 8 additions & 2 deletions lib/cunumeric_jl_wrapper/src/wrapper.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2025 Northwestern University,
/* Copyright 2026 Northwestern University,
* Carnegie Mellon University University
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,6 +15,7 @@
*
* Author(s): David Krasowska <krasow@u.northwestern.edu>
* Ethan Meitz <emeitz@andrew.cmu.edu>
* Nader Rahhal <naderrahhal2026@u.northwestern.edu>
*/

#include <initializer_list>
Expand Down Expand Up @@ -92,6 +93,10 @@ JLCXX_MODULE define_julia_module(jlcxx::Module& mod) {
using jlcxx::Parametric;
using jlcxx::TypeVar;

// Map C++ complex types to Julia complex types
mod.map_type<std::complex<double>>("ComplexF64");
mod.map_type<std::complex<float>>("ComplexF32");

// These are the types/dims used to generate templated functions
// i.e. only these types/dims can be used from Julia side
using fp_types = ParameterList<double, float>;
Expand All @@ -100,7 +105,8 @@ JLCXX_MODULE define_julia_module(jlcxx::Module& mod) {

using all_types =
ParameterList<double, float, int8_t, int16_t, int32_t, int64_t, uint8_t,
uint16_t, uint32_t, uint64_t, bool>;
uint16_t, uint32_t, uint64_t, bool, std::complex<double>,
std::complex<float>>;
using allowed_dims = ParameterList<
std::integral_constant<int_t, 1>, std::integral_constant<int_t, 2>,
std::integral_constant<int_t, 3>, std::integral_constant<int_t, 4>>;
Expand Down
24 changes: 17 additions & 7 deletions src/cuNumeric.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#= Copyright 2025 Northwestern University,
#= Copyright 2026 Northwestern University,
* Carnegie Mellon University University
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,6 +15,7 @@
*
* Author(s): David Krasowska <krasow@u.northwestern.edu>
* Ethan Meitz <emeitz@andrew.cmu.edu>
* Nader Rahhal <naderrahhal2026@u.northwestern.edu>
=#

module cuNumeric
Expand Down Expand Up @@ -56,8 +57,20 @@ const DEFAULT_INT = Int32

const SUPPORTED_INT_TYPES = Union{Int32,Int64}
const SUPPORTED_FLOAT_TYPES = Union{Float32,Float64}
const SUPPORTED_NUMERIC_TYPES = Union{SUPPORTED_INT_TYPES,SUPPORTED_FLOAT_TYPES}
const SUPPORTED_TYPES = Union{SUPPORTED_INT_TYPES,SUPPORTED_FLOAT_TYPES,Bool} #* TODO Test UInt, Complex
const SUPPORTED_COMPLEX_TYPES = Union{ComplexF32,ComplexF64}
const SUPPORTED_NUMERIC_TYPES = Union{
SUPPORTED_INT_TYPES,SUPPORTED_FLOAT_TYPES,SUPPORTED_COMPLEX_TYPES
}
# const SUPPORTED_TYPES = Union{SUPPORTED_INT_TYPES,SUPPORTED_FLOAT_TYPES,Bool} #* TODO Test UInt, Complex

const SUPPORTED_TYPES = Union{
Bool,
Int8,Int16,Int32,Int64,
UInt8,UInt16,UInt32,UInt64,
Float16,Float32,Float64,
ComplexF32,ComplexF64,
String,
}

# const MAX_DIM = 6 # idk what we compiled?

Expand Down Expand Up @@ -181,16 +194,14 @@ global cuNumeric_config_str::String = ""
const RUNTIME_INACTIVE = -1
const RUNTIME_ACTIVE = 0
const _runtime_ref = Ref{Int}(RUNTIME_INACTIVE)
const _start_lock = ReentrantLock()
const _start_lock = ReentrantLock()

runtime_started() = _runtime_ref[] == RUNTIME_ACTIVE

function _start_runtime()

Libdl.dlopen(CUPYNUMERIC_LIB_PATH, Libdl.RTLD_GLOBAL | Libdl.RTLD_NOW)
Libdl.dlopen(CUPYNUMERIC_WRAPPER_LIB_PATH, Libdl.RTLD_GLOBAL | Libdl.RTLD_NOW)


AA = ArgcArgv(String[])
# AA = ArgcArgv([Base.julia_cmd()[1]])
cuNumeric.initialize_cunumeric(AA.argc, getargv(AA))
Expand All @@ -200,7 +211,6 @@ function _start_runtime()

Base.atexit(my_on_exit)


return RUNTIME_ACTIVE
end

Expand Down
3 changes: 2 additions & 1 deletion src/ndarray/ndarray.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#= Copyright 2025 Northwestern University,
#= Copyright 2026 Northwestern University,
* Carnegie Mellon University University
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,6 +15,7 @@
*
* Author(s): David Krasowska <krasow@u.northwestern.edu>
* Ethan Meitz <emeitz@andrew.cmu.edu>
* Nader Rahhal <naderrahhal2026@u.northwestern.edu>
=#

export unwrap
Expand Down
2 changes: 1 addition & 1 deletion test/tests/linalg.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#= Copyright 2025 Northwestern University,
#= Copyright 2026 Northwestern University,
* Carnegie Mellon University University
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Loading