Skip to content

Commit 04e423a

Browse files
committed
Serious bug patch
1 parent 13a1e38 commit 04e423a

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Sources/CUDADriver/Function.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,4 +268,8 @@ public struct KernelArgument {
268268
return self.init(pointer.deviceAddress)
269269
}
270270

271+
public static func value<T>(_ value: T) -> KernelArgument {
272+
return self.init(value)
273+
}
274+
271275
}

Sources/CUDARuntime/Function.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,13 @@ public func >>>(lhs: (Int, Int, Int, Stream?), rhs: [KernelArgument]) -> (CUDARu
131131
}
132132

133133
public extension KernelArgument {
134+
134135
public static func pointer<T>(_ pointer: UnsafeMutableDevicePointer<T>) -> KernelArgument {
135136
return self.init(pointer.deviceAddress)
136137
}
138+
139+
public static func pointer<T>(_ pointer: UnsafeDevicePointer<T>) -> KernelArgument {
140+
return self.init(pointer.deviceAddress)
141+
}
142+
137143
}

0 commit comments

Comments
 (0)