Skip to content

Commit

Permalink
update to OCaml version 5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jzstark committed Jul 28, 2024
1 parent c788252 commit b988366
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/base/core/owl_const.ml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ let zero : type a b. (a, b) kind -> a = function
| Int -> 0
| Nativeint -> 0n
| Char -> '\000'
| _ -> failwith "not implemented"


let one : type a b. (a, b) kind -> a = function
Expand All @@ -75,6 +76,7 @@ let one : type a b. (a, b) kind -> a = function
| Int -> 1
| Nativeint -> 1n
| Char -> '\001'
| Float16 -> failwith "not implemented"


let neg_one : type a b. (a, b) kind -> a = function
Expand All @@ -91,6 +93,7 @@ let neg_one : type a b. (a, b) kind -> a = function
| Int -> -1
| Nativeint -> -1n
| Char -> '\255'
| Float16 -> failwith "not implemented"


let pos_inf : type a b. (a, b) kind -> a = function
Expand Down
2 changes: 2 additions & 0 deletions src/base/misc/owl_utils_ndarray.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ let elt_to_str : type a b. (a, b) kind -> a -> string = function
| Int -> fun v -> Printf.sprintf "%i" v
| Int32 -> fun v -> Printf.sprintf "%ld" v
| Int64 -> fun v -> Printf.sprintf "%Ld" v
| Float16 -> fun v -> Printf.sprintf "%G" v
| Float32 -> fun v -> Printf.sprintf "%G" v
| Float64 -> fun v -> Printf.sprintf "%G" v
| Complex32 -> fun v -> Printf.sprintf "(%G, %Gi)" Complex.(v.re) Complex.(v.im)
Expand All @@ -33,6 +34,7 @@ let elt_of_str : type a b. (a, b) kind -> string -> a = function
| Int -> fun v -> int_of_string v
| Int32 -> fun v -> Int32.of_string v
| Int64 -> fun v -> Int64.of_string v
| Float16 -> fun v -> float_of_string v
| Float32 -> fun v -> float_of_string v
| Float64 -> fun v -> float_of_string v
| Complex32 -> fun v ->
Expand Down
7 changes: 7 additions & 0 deletions src/owl/cblas/owl_cblas_basic.ml
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,7 @@ let symv
C.ssymv ~order:_layout ~uplo:_uplo ~n ~alpha ~a:_a ~lda ~x:_x ~incx ~beta ~y:_y ~incy
| Bigarray.Float64 ->
C.dsymv ~order:_layout ~uplo:_uplo ~n ~alpha ~a:_a ~lda ~x:_x ~incx ~beta ~y:_y ~incy
| _ -> failwith "not implemented"


(* Computes a matrix-vector product using a symmetric band matrix. *)
Expand Down Expand Up @@ -915,6 +916,7 @@ let sbmv
~beta
~y:_y
~incy
| _ -> failwith "not implemented"


(* Computes a matrix-vector product using a symmetric packed matrix. *)
Expand Down Expand Up @@ -945,6 +947,7 @@ let spmv
C.sspmv ~order:_layout ~uplo:_uplo ~n ~alpha ~ap:_ap ~x:_x ~incx ~beta ~y:_y ~incy
| Bigarray.Float64 ->
C.dspmv ~order:_layout ~uplo:_uplo ~n ~alpha ~ap:_ap ~x:_x ~incx ~beta ~y:_y ~incy
| _ -> failwith "not implemented"


(* Performs a rank-1 update of a general matrix. *)
Expand Down Expand Up @@ -1051,6 +1054,7 @@ let syr
match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.ssyr ~order:_layout ~uplo:_uplo ~n ~alpha ~x:_x ~incx ~a:_a ~lda
| Bigarray.Float64 -> C.dsyr ~order:_layout ~uplo:_uplo ~n ~alpha ~x:_x ~incx ~a:_a ~lda
| _ -> failwith "not implemented"


(* Performs a rank-1 update of a symmetric packed matrix. *)
Expand All @@ -1074,6 +1078,7 @@ let spr
match Bigarray.Array1.kind x with
| Bigarray.Float32 -> C.sspr ~order:_layout ~uplo:_uplo ~n ~alpha ~x:_x ~incx ~ap:_ap
| Bigarray.Float64 -> C.dspr ~order:_layout ~uplo:_uplo ~n ~alpha ~x:_x ~incx ~ap:_ap
| _ -> failwith "not implemented"


(* Performs a rank-2 update of symmetric matrix. *)
Expand Down Expand Up @@ -1103,6 +1108,7 @@ let syr2
C.ssyr2 ~order:_layout ~uplo:_uplo ~n ~alpha ~x:_x ~incx ~y:_y ~incy ~a:_a ~lda
| Bigarray.Float64 ->
C.dsyr2 ~order:_layout ~uplo:_uplo ~n ~alpha ~x:_x ~incx ~y:_y ~incy ~a:_a ~lda
| _ -> failwith "not implemented"


(* Performs a rank-2 update of a symmetric packed matrix. *)
Expand Down Expand Up @@ -1131,6 +1137,7 @@ let spr2
C.sspr2 ~order:_layout ~uplo:_uplo ~n ~alpha ~x:_x ~incx ~y:_y ~incy ~a:_a
| Bigarray.Float64 ->
C.dspr2 ~order:_layout ~uplo:_uplo ~n ~alpha ~x:_x ~incx ~y:_y ~incy ~a:_a
| _ -> failwith "not implemented"


(* Computes a matrix-vector product using a Hermitian matrix. *)
Expand Down
16 changes: 16 additions & 0 deletions src/owl/lapacke/owl_lapacke.ml
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ let ormrz
match _kind with
| Float32 -> L.sormrz ~layout ~side ~trans ~m ~n ~k ~l ~a:_a ~lda ~tau:_tau ~c:_c ~ldc
| Float64 -> L.dormrz ~layout ~side ~trans ~m ~n ~k ~l ~a:_a ~lda ~tau:_tau ~c:_c ~ldc
| _ -> failwith "not implemented"
in
check_lapack_error ret;
c
Expand Down Expand Up @@ -2134,6 +2135,7 @@ let orglq : type a. ?k:int -> a:(float, a) t -> tau:(float, a) t -> (float, a) t
match _kind with
| Float32 -> L.sorglq ~layout ~m:minmn ~n ~k ~a:_a ~lda ~tau:_tau
| Float64 -> L.dorglq ~layout ~m:minmn ~n ~k ~a:_a ~lda ~tau:_tau
| _ -> failwith "not implemented"
in
check_lapack_error ret;
(* extract the first leading rows if necessary *)
Expand Down Expand Up @@ -2198,6 +2200,7 @@ let orgqr : type a. ?k:int -> a:(float, a) t -> tau:(float, a) t -> (float, a) t
match _kind with
| Float32 -> L.sorgqr ~layout ~m ~n:minmn ~k ~a:_a ~lda ~tau:_tau
| Float64 -> L.dorgqr ~layout ~m ~n:minmn ~k ~a:_a ~lda ~tau:_tau
| _ -> failwith "not implemented"
in
check_lapack_error ret;
(* extract the first leading columns if necessary *)
Expand Down Expand Up @@ -2262,6 +2265,7 @@ let orgql : type a. ?k:int -> a:(float, a) t -> tau:(float, a) t -> (float, a) t
match _kind with
| Float32 -> L.sorgql ~layout ~m ~n:minmn ~k ~a:_a ~lda ~tau:_tau
| Float64 -> L.dorgql ~layout ~m ~n:minmn ~k ~a:_a ~lda ~tau:_tau
| _ -> failwith "not implemented"
in
check_lapack_error ret;
(* extract the first leading columns if necessary *)
Expand Down Expand Up @@ -2293,6 +2297,7 @@ let orgrq : type a. ?k:int -> a:(float, a) t -> tau:(float, a) t -> (float, a) t
match _kind with
| Float32 -> L.sorgrq ~layout ~m ~n:minmn ~k ~a:_a ~lda ~tau:_tau
| Float64 -> L.dorgrq ~layout ~m ~n:minmn ~k ~a:_a ~lda ~tau:_tau
| _ -> failwith "not implemented"
in
check_lapack_error ret;
(* extract the first leading columns if necessary *)
Expand Down Expand Up @@ -2335,6 +2340,7 @@ let ormlq
match _kind with
| Float32 -> L.sormlq ~layout ~side ~trans ~m ~n ~k ~a:_a ~lda ~tau:_tau ~c:_c ~ldc
| Float64 -> L.dormlq ~layout ~side ~trans ~m ~n ~k ~a:_a ~lda ~tau:_tau ~c:_c ~ldc
| _ -> failwith "not implemented"
in
check_lapack_error ret;
c
Expand Down Expand Up @@ -2373,6 +2379,7 @@ let ormqr
match _kind with
| Float32 -> L.sormqr ~layout ~side ~trans ~m ~n ~k ~a:_a ~lda ~tau:_tau ~c:_c ~ldc
| Float64 -> L.dormqr ~layout ~side ~trans ~m ~n ~k ~a:_a ~lda ~tau:_tau ~c:_c ~ldc
| _ -> failwith "not implemented"
in
check_lapack_error ret;
c
Expand Down Expand Up @@ -2411,6 +2418,7 @@ let ormql
match _kind with
| Float32 -> L.sormql ~layout ~side ~trans ~m ~n ~k ~a:_a ~lda ~tau:_tau ~c:_c ~ldc
| Float64 -> L.dormql ~layout ~side ~trans ~m ~n ~k ~a:_a ~lda ~tau:_tau ~c:_c ~ldc
| _ -> failwith "not implemented"
in
check_lapack_error ret;
c
Expand Down Expand Up @@ -2449,6 +2457,7 @@ let ormrq
match _kind with
| Float32 -> L.sormrq ~layout ~side ~trans ~m ~n ~k ~a:_a ~lda ~tau:_tau ~c:_c ~ldc
| Float64 -> L.dormrq ~layout ~side ~trans ~m ~n ~k ~a:_a ~lda ~tau:_tau ~c:_c ~ldc
| _ -> failwith "not implemented"
in
check_lapack_error ret;
c
Expand Down Expand Up @@ -3129,6 +3138,7 @@ let stev
match _kind with
| Float32 -> L.sstev ~layout ~jobz ~n ~d:_d ~e:_e ~z:_z ~ldz
| Float64 -> L.dstev ~layout ~jobz ~n ~d:_d ~e:_e ~z:_z ~ldz
| _ -> failwith "not implemented"
in
check_lapack_error ret;
d, z
Expand Down Expand Up @@ -3201,6 +3211,7 @@ let stebz
~w:_w
~iblock:_iblock
~isplit:_isplit
| _ -> failwith "not implemented"
in
check_lapack_error ret;
let m = Int32.to_int !@_m in
Expand Down Expand Up @@ -3786,6 +3797,7 @@ let syev : type a. jobz:char -> uplo:char -> a:(float, a) t -> (float, a) t * (f
match _kind with
| Float32 -> L.ssyev ~layout ~jobz ~uplo ~n ~a:_a ~lda ~w:_w
| Float64 -> L.dsyev ~layout ~jobz ~uplo ~n ~a:_a ~lda ~w:_w
| _ -> failwith "not implemented"
in
check_lapack_error ret;
match jobz with
Expand Down Expand Up @@ -3876,6 +3888,7 @@ let syevr
~z:_z
~ldz
~isuppz:_isuppz
| _ -> failwith "not implemented"
in
check_lapack_error ret;
let m = Int32.to_int !@_m in
Expand Down Expand Up @@ -3916,6 +3929,7 @@ let sygvd
match _kind with
| Float32 -> L.ssygvd ~layout ~ityp ~jobz ~uplo ~n ~a:_a ~lda ~b:_b ~ldb ~w:_w
| Float64 -> L.dsygvd ~layout ~ityp ~jobz ~uplo ~n ~a:_a ~lda ~b:_b ~ldb ~w:_w
| _ -> failwith "not implemented"
in
check_lapack_error ret;
w, a, b
Expand Down Expand Up @@ -4095,6 +4109,7 @@ let bdsdc
L.sbdsdc ~layout ~uplo ~compq ~n ~d:_d ~e:_e ~u:_u ~ldu ~vt:_vt ~ldvt ~q:_q ~iq:_iq
| Float64 ->
L.dbdsdc ~layout ~uplo ~compq ~n ~d:_d ~e:_e ~u:_u ~ldu ~vt:_vt ~ldvt ~q:_q ~iq:_iq
| _ -> failwith "not implemented"
in
check_lapack_error ret;
d, e, u, vt, q, iq
Expand Down Expand Up @@ -4183,6 +4198,7 @@ let orghr
match _kind with
| Float32 -> L.sorghr ~layout ~n ~ilo ~ihi ~a:_a ~lda ~tau:_tau
| Float64 -> L.dorghr ~layout ~n ~ilo ~ihi ~a:_a ~lda ~tau:_tau
| _ -> failwith "not implemented"
in
check_lapack_error ret;
a
Expand Down

0 comments on commit b988366

Please sign in to comment.