Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/vis15/doc/implementation/json-api.txt
ViewVC logotype

Annotation of /branches/vis15/doc/implementation/json-api.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4966 - (view) (download)

1 : jhr 4966 Below are the descriptions of fields and arrays in the PROGRAM.json file
2 :    
3 :     Program Descriptions
4 :    
5 :     “src-file” : FILE - the diderot program source of this JSON file
6 :     "version" : VER - the diderot program version the JSON file draw from
7 :     "program" : PROGNAME - the name of the diderot program
8 :    
9 :     Purpose fields - These fields are the most general descriptors of the functions in the diderot program. These fields describe what in general this function modifies/inputs/runs in relation to the program. Within these fields are an array of the functions that can be categorized within the purpose.
10 :    
11 :     “inputs” : [FUNCTIONS] - describes the diderot functions with relation to inputs of the diderot program
12 :     “outputs” : [FUNCTIONS] - describes the diderot functions with relation to outputs of the diderot program
13 :     “runtime” : [FUNCTIONS] - describes the diderot functions with relation to runtime operations of the diderot program
14 :     “control” : [FUNCTIONS] - describes the diderot functions with relation to control operations of the diderot program
15 :     “query” : [FUNCTIONS] - describes the diderot functions with relation to querying information about the diderot program
16 :    
17 :     Function objects - These are the objects within the arrays of the purpose fields. In these objects is information on the type of function. The general example is posted below with comments (denoted by // or /* */) describing their function.
18 :    
19 :    
20 :     {
21 :     //"name" refers to what aspect of the diderot program the function(s) pertains to
22 :     //In this case, it is "minVal"
23 :     "name" : "minVal",
24 :    
25 :     //"type" provides information on the attributes of the diderot function we are describing
26 :     "type" : {"kind" : "tensor",
27 :     "shape" : []},
28 :    
29 :     /* "get" here may be replaced by either "set" or "func"
30 :     * "get" - occurs when the aspect described by "name" has a get-function
31 :     * "set" - occurs when the aspect described by "name" has a set-function
32 :     * usually, "get" and "set" will be paired together as two different fields within the function object
33 :     * "func" - when the aspect has neither a get or set function, but does something entirely different
34 :     * "func" provides structure to the json and may be re-done later
35 :     * usually, "func" will be alone
36 :     */
37 :     "get" : {
38 :    
39 :     /* "return-ty" is the return-type of the function
40 :     * If it is neither an array, or a pointer, it may just be described as a simple string
41 :     * Here, it is "void"
42 :     * But if it is a pointer or an array, the return-type is written as follows:
43 :     * "return-ty" : {
44 :     * "kind" : "*" OR [],
45 :     * "arg" : THE TYPE OF THE POINTER OR ARRAY
46 :     * "length" : []}
47 :     * If the type is a pointer, "length" may be omitted
48 :     */
49 :     "return-ty" : "void",
50 :    
51 :     //This inner "name" is the c-prototype function of the diderot instruction
52 :     "name" : "Diderot_input_get_minval",
53 :    
54 :     /* "params" is an array of the parameters described as objects of the c-prototype function
55 :     * Within each object:
56 :     * "name" - the name of the parameter
57 :     * "param-ty" - the type of the parameter, structured the same way as "return-ty"
58 :     * "attrbs" - the diderot attributes of each parameter
59 :     */
60 :     "params" : [{
61 :     "name" : "wrld",
62 :     "param-ty" : {
63 :     "kind" : "*",
64 :     "arg" : "Diderot_world_t"},
65 :     "attrbs" : ["world"]
66 :     },
67 :     {
68 :     "name" : "v",
69 :     "param-ty" : {
70 :     "kind" : "*",
71 :     "arg" : "float"},
72 :     "attrbs" : ["out"]
73 :     }]
74 :     }
75 :    
76 :     End of File

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0