{
    "CpuGpuData" : {
        "version": 1,
        "categories": "tutorials",
        "memoryType": "any",
        "description": [
            "This is a tutorial node. It illustrates how to access data whose memory location, CPU or GPU, is ",
            "determined at runtime in the compute method. The data types are the same as for the purely CPU and ",
            "purely GPU tutorials, it is only the access method that changes. The input 'is_gpu' determines where ",
            "the data of the other attributes can be accessed."
        ],
        "metadata":
        {
            "uiName": "Tutorial Node: Attributes With CPU/GPU Data"
        },
        "inputs": {
            "is_gpu": {
                "type": "bool",
                "memoryType": "cpu",
                "description": ["Runtime switch determining where the data for the other attributes lives."],
                "default": false
            },
            "a": {
                "type": "float",
                "description": ["First value to be added in algorithm 1"],
                "default": 0.0
            },
            "b": {
                "type": "float",
                "description": ["Second value to be added in algorithm 1"],
                "default": 0.0
            },
            "points": {
                "type": "float[3][]",
                "description": ["Points to be moved by algorithm 2"],
                "default": []
            },
            "multiplier": {
                "type": "float[3]",
                "description": ["Amplitude of the expansion for the input points in algorithm 2"],
                "default": [1.0, 1.0, 1.0]
            }
        },
        "outputs": {
            "sum": {
                "type": "float",
                "description": ["Sum of the two inputs from algorithm 1"]
            },
            "points": {
                "type": "float[3][]",
                "description": ["Final positions of points from algorithm 2"]
            }
        },
        "tests": [
            { "inputs:is_gpu": false, "inputs:a": 1.0, "inputs:b": 2.0, "outputs:sum": 3.0 },
            { "inputs:is_gpu": false, "inputs:a": 5.0, "inputs:b": 3.0, "outputs:sum": 8.0 },
            {
                "inputs:is_gpu": false,
                "inputs:points": [[1.0, 2.0, 3.0], [2.0, 3.0, 4.0]],
                "inputs:multiplier": [2.0, 3.0, 4.0],
                "outputs:points": [[2.0, 6.0, 12.0], [4.0, 9.0, 16.0]]
            },
            {
                "inputs:is_gpu": true,
                "inputs:a": 1.0, "inputs:b": 2.0,
                "inputs:points": [[1.0, 2.0, 3.0], [2.0, 3.0, 4.0]],
                "inputs:multiplier": [2.0, 3.0, 4.0]
            }
        ],
        "$why_disabled": "GPU extraction is not yet implemented so for those tests only inputs are provided",
        "$tests_disabled_until_gpu_data_extraction_works": [
            { "inputs:is_gpu": true, "inputs:a": 1.0, "inputs:b": 2.0, "outputs:sum": 3.0, "gpu": ["outputs:sum"] },
            { "inputs:is_gpu": true, "inputs:a": 5.0, "inputs:b": 3.0, "outputs:sum": 8.0, "gpu": ["outputs:sum"] },
            {
                "inputs:is_gpu": true,
                "inputs:points": [[1.0, 2.0, 3.0], [2.0, 3.0, 4.0]],
                "inputs:multiplier": [2.0, 3.0, 4.0],
                "outputs:points": [[2.0, 6.0, 12.0], [4.0, 9.0, 16.0]],
                "gpu": ["outputs:points"]
            }
        ]
    }
}
