File tree Expand file tree Collapse file tree
appleMain/kotlin/sk/ai/net/performance
jvmMain/kotlin/sk/ai/net/performance
linuxMain/kotlin/sk/ai/net/performance
src/commonMain/kotlin/sk/ai/net/gguf Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ kotlin {
2424 iosArm64()
2525 iosSimulatorArm64()
2626 wasmJs().nodejs()
27+ macosX64 ()
28+ linuxX64 ()
29+
2730
2831 sourceSets {
2932 val commonMain by getting {
File renamed without changes.
Original file line number Diff line number Diff line change 11package sk.ai.net.performance
22
3- actual fun currentMillis (): Long = System .currentTimeMillis()
3+ actual fun currentMillis (): Long = System .currentTimeMillis()
Original file line number Diff line number Diff line change 1+ package sk.ai.net.performance
2+
3+ import kotlinx.cinterop.ExperimentalForeignApi
4+ import kotlinx.cinterop.alloc
5+ import kotlinx.cinterop.memScoped
6+ import kotlinx.cinterop.ptr
7+ import platform.posix.gettimeofday
8+ import platform.posix.timeval
9+
10+ @OptIn(ExperimentalForeignApi ::class )
11+ actual fun currentMillis (): Long = memScoped {
12+ val tv = alloc< timeval> ()
13+ gettimeofday(tv.ptr, null )
14+ tv.tv_sec * 1000L + tv.tv_usec / 1000L
15+ }
16+
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ kotlin {
2323 iosArm64()
2424 iosSimulatorArm64()
2525 wasmJs().nodejs()
26+ macosX64 ()
27+ linuxX64 ()
28+
2629
2730 sourceSets {
2831 val commonMain by getting {
Original file line number Diff line number Diff line change 11package sk.ai.net.gguf
22
3- import kotlinx.io.Buffer
43import kotlinx.io.Source
54import kotlinx.io.readByteArray
65import sk.ai.net.gguf.utils.Endian
@@ -53,7 +52,7 @@ data class FieldParts(
5352)
5453
5554@OptIn(ExperimentalUnsignedTypes ::class )
56- class GGUFReader (bufferedSource : Source ) {
55+ class GGUFReader (source : Source ) {
5756 // Properties
5857 var byteOrder: Char = ' I' // 'I' - same as host, 'S' - swapped
5958 var alignment: Int = GGUF_DEFAULT_ALIGNMENT
@@ -81,7 +80,7 @@ class GGUFReader(bufferedSource: Source) {
8180 )
8281
8382 init {
84- data = bufferedSource .readByteArray()
83+ data = source .readByteArray()
8584
8685 checkGGUFMagicNumber().then {
8786 checkGGUFVersion().then {
Original file line number Diff line number Diff line change 11[versions ]
2- agp = " 8.7.3 "
3- kotlin = " 2.1.0 "
2+ agp = " 8.7.2 "
3+ kotlin = " 2.0.21 "
44kotlinx-coroutines = " 1.10.1"
55android-minSdk = " 24"
66android-compileSdk = " 35"
7- kotlinxSerializationJson = " 1.8.0 "
7+ kotlinxSerializationJson = " 1.7.3 "
88nexus-publish = " 2.0.0"
99jetbrainsKotlinJvm = " 1.9.22"
1010testng = " 7.10.2"
Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ kotlin {
2525 iosArm64()
2626 iosSimulatorArm64()
2727 wasmJs().nodejs()
28-
28+ macosX64 ()
29+ linuxX64 ()
2930
3031 sourceSets {
3132 val commonMain by getting {
You can’t perform that action at this time.
0 commit comments