diff --git a/examples/cuda-fanout/gpu-worker.lsp b/examples/cuda-fanout/gpu-worker.lsp index 432ad58..a81e7a6 100644 --- a/examples/cuda-fanout/gpu-worker.lsp +++ b/examples/cuda-fanout/gpu-worker.lsp @@ -273,10 +273,12 @@ (cond ((eq? status 'ok) (let ((result-blob (read-binary-file out-path))) - (delete-file in-path) (delete-file out-path) + (if (file-exists? in-path) (delete-file in-path)) + (if (file-exists? out-path) (delete-file out-path)) (wire-send-raw client (string-append "BSHR" result-blob)))) (else - (delete-file in-path) (delete-file out-path) + (if (file-exists? in-path) (delete-file in-path)) + (if (file-exists? out-path) (delete-file out-path)) (wire-send-raw client (string-append "BERR" (cdr status)))))))) ;; Binary wire for bend form B (cuda-bignum-cgbn). @@ -296,7 +298,8 @@ (cond ((eq? status 'ok) (let ((result-blob (read-binary-file out-path))) - (delete-file in-path) (delete-file out-path) + (if (file-exists? in-path) (delete-file in-path)) + (if (file-exists? out-path) (delete-file out-path)) (display ";;; bend DONE cuda-bignum-cgbn") (display " wall-ms=") (display wall-ms) (display " out-bytes=") (display (string-length result-blob)) @@ -305,7 +308,8 @@ (else (display ";;; bend FAIL cuda-bignum-cgbn wall-ms=") (display wall-ms) (newline) - (delete-file in-path) (delete-file out-path) + (if (file-exists? in-path) (delete-file in-path)) + (if (file-exists? out-path) (delete-file out-path)) (wire-send-raw client (string-append "BERR" (cdr status))))))))) ;; Binary wire for bend form A (cuda-secp256k1-batched-mul). @@ -326,7 +330,8 @@ (cond ((eq? status 'ok) (let ((result-blob (read-binary-file out-path))) - (delete-file in-path) (delete-file out-path) + (if (file-exists? in-path) (delete-file in-path)) + (if (file-exists? out-path) (delete-file out-path)) (display ";;; bend DONE cuda-secp256k1-batched-mul") (display " wall-ms=") (display wall-ms) (display " out-bytes=") (display (string-length result-blob)) @@ -335,7 +340,8 @@ (else (display ";;; bend FAIL cuda-secp256k1-batched-mul wall-ms=") (display wall-ms) (newline) - (delete-file in-path) (delete-file out-path) + (if (file-exists? in-path) (delete-file in-path)) + (if (file-exists? out-path) (delete-file out-path)) (wire-send-raw client (string-append "BERR" (cdr status))))))))) ;; Accept one client, handle one request, close. Returns #t to keep