diff --git a/src/Aardvark.Base/Introspection/Introspection.cs b/src/Aardvark.Base/Introspection/Introspection.cs index 25e64d30..e94d80ca 100644 --- a/src/Aardvark.Base/Introspection/Introspection.cs +++ b/src/Aardvark.Base/Introspection/Introspection.cs @@ -2073,8 +2073,12 @@ private static string ArchitectureString(Architecture arch) } } + private static bool isInitialized = false; + public static void Init() { + if (isInitialized) return; + Report.BeginTimed("initializing aardvark"); Report.Begin("System Information:"); @@ -2188,6 +2192,8 @@ public static void Init() } Report.End(); + + isInitialized = true; } private static void LoadAll(IEnumerable xs) diff --git a/src/Tests/Aardvark.Base.FSharp.Tests/Tensors/TensorTests.fs b/src/Tests/Aardvark.Base.FSharp.Tests/Tensors/TensorTests.fs index 51e10175..2d8147b3 100644 --- a/src/Tests/Aardvark.Base.FSharp.Tests/Tensors/TensorTests.fs +++ b/src/Tests/Aardvark.Base.FSharp.Tests/Tensors/TensorTests.fs @@ -209,8 +209,8 @@ module ``Tensor Tests`` = let data = [| 42; 32; 108; -34 |] let info = Tensor4Info(V4l(2, 2, 1, 1), V4l(1, 2, 4, 4)) - pinned data (fun ptr -> - let nv = NativeTensor4.ofNativeInt info ptr + data |> NativePtr.pinArr (fun ptr -> + let nv = NativeTensor4(ptr, info) let mutable index = 0 nv |> NativeTensor4.iterPtr (fun coord ptr -> @@ -226,10 +226,10 @@ module ``Tensor Tests`` = let dstArray = [| 0L; 0L; 0L; 0L |] let info = Tensor4Info(V4l(2, 2, 1, 1), V4l(2, 1, 4, 4)) - pinned srcArray (fun srcPtr -> - pinned dstArray (fun dstPtr -> - let src = NativeTensor4(NativePtr.ofNativeInt srcPtr, info) - let dst = NativeTensor4(NativePtr.ofNativeInt dstPtr, info) + srcArray |> NativePtr.pinArr (fun srcPtr -> + dstArray |> NativePtr.pinArr (fun dstPtr -> + let src = NativeTensor4(srcPtr, info) + let dst = NativeTensor4(dstPtr, info) (src, dst) ||> NativeTensor4.iterPtr2 (fun coord src dst -> let value = NativePtr.read src