iu-parfunc / accelerack

C Bindings for Accelerate, Racket Frontend to Accelerate
2 stars 2 forks source link

Cleaner interface for allocate.rkt #36

Open rrnewton opened 8 years ago

rrnewton commented 8 years ago

The current interface is captured by these contracts:

  (contract-out
    [acc-alloc (-> (or/c ctype? pair?) (or/c null? pair?) (or/c number? boolean? list?) acc-manifest-array?)]
    [generatePayload (-> pair? (or/c ctype? symbol?) segment?)]
    [alloc-unit (-> (or/c null? pair?) (or/c ctype? pair?) acc-manifest-array?)]
    [read-data (-> segment? (or/c null? pair?))]
    [read-data* (-> acc-manifest-array? pair?)]
    [get-type (-> acc-manifest-array? integer?)]
    [get-shape (-> acc-manifest-array? (or/c null? pair?))]
    [get-result-array (-> acc-manifest-array? acc-manifest-array?)]
    [type (-> (or/c acc-manifest-array? segment?) integer?)]
    [shape (-> acc-manifest-array? (or/c null? pair?))])

With a proper acc-type? predicate (SExp representation), then the contract of, e.g., acc-alloc should become simpler.

For some of these others... I'm not sure if they need to be exposed.

rrnewton commented 8 years ago

This is a blocker for #27.