;; test-gpu-bridge.scm — Quick test of GPU AtomSpace Scheme bridge
;; Run: (load "test-gpu-bridge.scm") in CogServer
(load "gpu-atomspace.scm")
(format #t "\n=== GPU AtomSpace Bridge Test ===\n\n")
;; Init
(gpu-init!)
(gpu-status)
;; Process some sentences
(gpu-process-sentences!
'(("the" "cat" "sat" "on" "the" "mat")
("a" "dog" "ran" "in" "the" "park")
("the" "bird" "flew" "over" "the" "tree")))
(gpu-status)
;; Compute MI
(gpu-compute-mi!)
;; Read pairs
(let ((pairs (gpu-read-pairs #:max-pairs 100)))
(format #t "\nTop 10 pairs by MI:\n")
(let ((sorted (sort pairs (lambda (a b) (> (cadddr a) (cadddr b))))))
(for-each
(lambda (p)
(format #t " ~a — ~a count=~,1f MI=~,3f\n"
(car p) (cadr p) (caddr p) (cadddr p)))
(take sorted (min 10 (length sorted))))))
(gpu-corpus-status)
;; Shutdown
(gpu-shutdown!)
(format #t "\n=== DONE ===\n")