mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-24 09:21:16 +08:00

* more async eval * fix rebase * try correct async eval * fix async * more tests for async eval * use shared events for synchronization * comment + cleanup * with autorelease pool * fix no metal build * fix compile * fix patch * don't eval if asyn evale'd * don't use is_evaled * comments * more multi stream tests * try and cleanup use of is_evaled * use a status flag
37 lines
1.4 KiB
Diff
37 lines
1.4 KiB
Diff
diff -ur Metal/MTLEvent.hpp MetalNew/MTLEvent.hpp
|
|
--- Metal/MTLEvent.hpp 2024-04-15 07:12:10
|
|
+++ MetalNew/MTLEvent.hpp 2024-04-15 07:15:50
|
|
@@ -62,6 +62,7 @@
|
|
|
|
uint64_t signaledValue() const;
|
|
void setSignaledValue(uint64_t signaledValue);
|
|
+ bool waitUntilSignaledValue(uint64_t signaledValue, uint64_t timeoutMS);
|
|
};
|
|
|
|
class SharedEventHandle : public NS::SecureCoding<SharedEventHandle>
|
|
@@ -138,6 +139,11 @@
|
|
_MTL_INLINE void MTL::SharedEvent::setSignaledValue(uint64_t signaledValue)
|
|
{
|
|
Object::sendMessage<void>(this, _MTL_PRIVATE_SEL(setSignaledValue_), signaledValue);
|
|
+}
|
|
+
|
|
+// method: waitUntilSignaledValue
|
|
+_MTL_INLINE bool MTL::SharedEvent::waitUntilSignaledValue(uint64_t signaledValue, uint64_t timeoutMS) {
|
|
+ return Object::sendMessage<bool>(this, _MTL_PRIVATE_SEL(waitUntilSignaledValue_timeoutMS_), signaledValue, timeoutMS);
|
|
}
|
|
|
|
// static method: alloc
|
|
diff -ur Metal/MTLHeaderBridge.hpp MetalNew/MTLHeaderBridge.hpp
|
|
--- Metal/MTLHeaderBridge.hpp 2024-04-15 07:12:10
|
|
+++ MetalNew/MTLHeaderBridge.hpp 2024-04-15 07:16:15
|
|
@@ -1918,6 +1918,9 @@
|
|
"setShouldMaximizeConcurrentCompilation:");
|
|
_MTL_PRIVATE_DEF_SEL(setSignaledValue_,
|
|
"setSignaledValue:");
|
|
+_MTL_PRIVATE_DEF_SEL(
|
|
+ waitUntilSignaledValue_timeoutMS_,
|
|
+ "waitUntilSignaledValue:timeoutMS:");
|
|
_MTL_PRIVATE_DEF_SEL(setSize_,
|
|
"setSize:");
|
|
_MTL_PRIVATE_DEF_SEL(setSlice_,
|