Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to swift 5.9 and Xcode 15 #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.2
// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand Down
6 changes: 3 additions & 3 deletions Sources/DL4S/Engine/CPU/CPUEngine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ public struct CPUEngine: EngineType {
dstIdx += indices[offset + i] * dstStrides[arangement[i]]
}

dstMem.advanced(by: dstIdx).assign(from: sourceMem.advanced(by: srcIdx), count: copyCount)
dstMem.advanced(by: dstIdx).update(from: sourceMem.advanced(by: srcIdx), count: copyCount)
}
}

Expand Down Expand Up @@ -1015,7 +1015,7 @@ public struct CPUEngine: EngineType {
dstIdx += dstStrides[i] * idx[i]
}

dst.advanced(by: dstIdx).assign(from: src.advanced(by: srcIdx), count: copyCount)
dst.advanced(by: dstIdx).update(from: src.advanced(by: srcIdx), count: copyCount)
}

offset += copyCount
Expand Down Expand Up @@ -1095,7 +1095,7 @@ public struct CPUEngine: EngineType {
for srcIdx in 0 ..< count {
let dstIdx = count - srcIdx - 1

dstPtr.advanced(by: dstIdx * stride).assign(from: srcPtr.advanced(by: srcIdx * stride), count: stride)
dstPtr.advanced(by: dstIdx * stride).update(from: srcPtr.advanced(by: srcIdx * stride), count: stride)
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/DL4S/Memory Management/Allocator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ extension UnsafeMutableBufferPointer {
precondition(ptr.count >= count, "Out of bounds access")
precondition(self.count >= count, "Out of bounds write")
//memcpy(self.baseAddress!, ptr.baseAddress!, count * MemoryLayout<Element>.stride)
self.baseAddress!.assign(from: ptr.baseAddress!, count: count)
self.baseAddress!.update(from: ptr.baseAddress!, count: count)
}

func pointer(capacity: Int) -> UnsafeMutablePointer<Element> {
Expand Down
2 changes: 1 addition & 1 deletion Sources/DL4S/Util.swift
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public struct ProgressBar<UserInfo> {


public struct Progress<Element>: Sequence {
private struct ProgressIterator<Element>: IteratorProtocol {
private struct ProgressIterator: IteratorProtocol {
var baseIterator: AnyIterator<Element>
let totalUnitCount: Int
var currentCount: Int
Expand Down