// See the License for the specific language governing permissions and
// limitations under the License.
*/
-#include <../api/CPP/cldnn_defs.h>
-#include <../api/CPP/engine.hpp>
-#include <../api/CPP/memory.hpp>
-#include <../api/CPP/tensor.hpp>
-#include <../api/CPP/input_layout.hpp>
-#include <../api/CPP/data.hpp>
+#include <../api/engine.hpp>
+#include <../api/memory.hpp>
+#include <../api/tensor.hpp>
+#include <../api/input_layout.hpp>
+#include <../api/data.hpp>
#include <iostream>
/*! @page c1 Engine, layout, tensor, memory, data and input
* @section intro Introduction
data data("named_memory", memory1);
return engine;
-}
\ No newline at end of file
+}
// limitations under the License.
*/
-#include <../api/CPP/cldnn_defs.h>
-#include <../api/CPP/engine.hpp>
-#include <../api/CPP/input_layout.hpp>
-#include <../api/CPP/activation.hpp>
-#include <../api/CPP/softmax.hpp>
-#include <../api/CPP/memory.hpp>
-#include <../api/CPP/fully_connected.hpp>
-#include <../api/CPP/data.hpp>
-#include <../api/CPP/topology.hpp>
+#include <../api/engine.hpp>
+#include <../api/input_layout.hpp>
+#include <../api/activation.hpp>
+#include <../api/softmax.hpp>
+#include <../api/memory.hpp>
+#include <../api/fully_connected.hpp>
+#include <../api/data.hpp>
+#include <../api/topology.hpp>
#include <iostream>
#include "helper_functions.h"
activation relu(
"relu", // primitive identifier
"input", // identifier of input ( output of primitive with provided name is input to current )
- activation_relu);
+ activation_func::relu);
// Softmax is also very easy to create:
softmax softmax(
data fc_weights("fc_weights", weights_mem);
// Biases are optional but we can use those in this example. Create 'data' in the same way:
- auto bias_mem = memory::allocate(engine, { data_types::f32,format::bfyx,{ spatial(3) } }); // y, b and f will be set to ones by default
+ auto bias_mem = memory::allocate(engine, { data_types::f32,format::bfyx, tensor(spatial(3)) }); // y, b and f will be set to ones by default
// Use function to fill data:
set_values(bias_mem, { 0.0f, 1.0f, 0.5f });
// Create data primitive.
std::cout << it << std::endl;
}
return topology;
-}
\ No newline at end of file
+}
// limitations under the License.
*/
-#include <../api/CPP/cldnn_defs.h>
-#include <../api/CPP/engine.hpp>
-#include <../api/CPP/input_layout.hpp>
-#include <../api/CPP/memory.hpp>
-#include <../api/CPP/data.hpp>
-#include <../api/CPP/topology.hpp>
-#include <../api/CPP/network.hpp>
+#include <../api/engine.hpp>
+#include <../api/input_layout.hpp>
+#include <../api/memory.hpp>
+#include <../api/data.hpp>
+#include <../api/topology.hpp>
+#include <../api/network.hpp>
#include <iostream>
#include "helper_functions.h"
}
// What if someone may want to look into intermediate results (hidden layers). This will be described in next chapter (4).
-}
\ No newline at end of file
+}
// limitations under the License.
*/
-#include <../api/CPP/cldnn_defs.h>
-#include <../api/CPP/engine.hpp>
-#include <../api/CPP/input_layout.hpp>
-#include <../api/CPP/memory.hpp>
-#include <../api/CPP/data.hpp>
-#include <../api/CPP/topology.hpp>
-#include <../api/CPP/network.hpp>
+#include <../api/engine.hpp>
+#include <../api/input_layout.hpp>
+#include <../api/memory.hpp>
+#include <../api/data.hpp>
+#include <../api/topology.hpp>
+#include <../api/network.hpp>
#include <iostream>
#include "helper_functions.h"
// limitations under the License.
*/
-#include <../api/CPP/cldnn_defs.h>
-#include <../api/CPP/engine.hpp>
-#include <../api/CPP/input_layout.hpp>
-#include <../api/CPP/memory.hpp>
-#include <../api/CPP/data.hpp>
-#include <../api/CPP/topology.hpp>
-#include <../api/CPP/network.hpp>
+#include <../api/engine.hpp>
+#include <../api/input_layout.hpp>
+#include <../api/memory.hpp>
+#include <../api/data.hpp>
+#include <../api/topology.hpp>
+#include <../api/network.hpp>
#include <iostream>
#include <chrono>
// limitations under the License.
*/
-#include <../api/CPP/cldnn_defs.h>
-#include <../api/CPP/engine.hpp>
-#include <../api/CPP/input_layout.hpp>
-#include <../api/CPP/memory.hpp>
-#include <../api/CPP/data.hpp>
-#include <../api/CPP/topology.hpp>
-#include <../api/CPP/network.hpp>
-#include <../api/CPP/convolution.hpp>
+#include <../api/engine.hpp>
+#include <../api/input_layout.hpp>
+#include <../api/memory.hpp>
+#include <../api/data.hpp>
+#include <../api/topology.hpp>
+#include <../api/network.hpp>
+#include <../api/convolution.hpp>
#include <iostream>
#include <chrono>
// limitations under the License.
*/
-#include <../api/CPP/cldnn_defs.h>
-#include <../api/CPP/engine.hpp>
-#include <../api/CPP/input_layout.hpp>
-#include <../api/CPP/memory.hpp>
-#include <../api/CPP/data.hpp>
-#include <../api/CPP/topology.hpp>
-#include <../api/CPP/network.hpp>
-#include <../api/CPP/custom_gpu_primitive.hpp>
+#include <../api/engine.hpp>
+#include <../api/input_layout.hpp>
+#include <../api/memory.hpp>
+#include <../api/data.hpp>
+#include <../api/topology.hpp>
+#include <../api/network.hpp>
+#include <../api/custom_gpu_primitive.hpp>
#include <iostream>
#include <iomanip>
#include <chrono>
std::string entry_point = "add_kernel";
// Parameter binding for the custom primitive
- std::vector<cldnn_arg> parameters = { { arg_input, 0 }, { arg_input, 1 }, { arg_output, 0 } };
+ std::vector<custom_gpu_primitive::arg_desc> parameters = { { custom_gpu_primitive::arg_input, 0 }, { custom_gpu_primitive::arg_input, 1 }, { custom_gpu_primitive::arg_output, 0 } };
// Output layout for the custom primitive
layout output_layout = my_layout;
// limitations under the License.
*/
-#include <../api/CPP/cldnn_defs.h>
-#include <../api/CPP/engine.hpp>
-#include <../api/CPP/input_layout.hpp>
-#include <../api/CPP/memory.hpp>
-#include <../api/CPP/data.hpp>
-#include <../api/CPP/topology.hpp>
-#include <../api/CPP/network.hpp>
-#include <../api/CPP/activation.hpp>
-#include <../api/CPP/crop.hpp>
-#include <../api/CPP/resample.hpp>
+#include <../api/engine.hpp>
+#include <../api/input_layout.hpp>
+#include <../api/memory.hpp>
+#include <../api/data.hpp>
+#include <../api/topology.hpp>
+#include <../api/network.hpp>
+#include <../api/activation.hpp>
+#include <../api/crop.hpp>
+#include <../api/resample.hpp>
#include <iostream>
#include <chrono>
// Create a topology and add primitives
topology topology;
topology.add(input_layout("input", input_prim.get_layout()));
- topology.add(resample("resample", "input", 2, 4, resample_type::nearest));
- topology.add(activation("relu", "resample", activation_relu));
+ topology.add(resample("resample", "input", tensor(spatial(2)), 4, resample_type::nearest));
+ topology.add(activation("relu", "resample", activation_func::relu));
topology.add(crop("crop1", "relu", tensor(batch(1), spatial(2, 2), feature(3)), { tensor(feature(0), spatial(0,0),batch(0)) }));
topology.add(crop("crop2", "relu", tensor(batch(1), spatial(2, 2), feature(1)), { tensor(feature(3), spatial(0,0),batch(0)) }));
- topology.add(activation("relu1", "crop1", activation_relu));
- topology.add(activation("relu2", "crop2", activation_relu));
+ topology.add(activation("relu1", "crop1", activation_func::relu));
+ topology.add(activation("relu2", "crop2", activation_func::relu));
// Build network without optimize data build option
network network_1(engine, topology);
-#include <api/CPP/memory.hpp>
-#include <api/CPP/topology.hpp>
-#include <api/CPP/reorder.hpp>
-#include <api/CPP/input_layout.hpp>
-#include <api/CPP/convolution.hpp>
-#include <api/CPP/data.hpp>
-#include <api/CPP/pooling.hpp>
-#include <api/CPP/fully_connected.hpp>
-#include <api/CPP/softmax.hpp>
-#include <api/CPP/engine.hpp>
-#include <api/CPP/network.hpp>
+#include <api/memory.hpp>
+#include <api/topology.hpp>
+#include <api/reorder.hpp>
+#include <api/input_layout.hpp>
+#include <api/convolution.hpp>
+#include <api/data.hpp>
+#include <api/pooling.hpp>
+#include <api/fully_connected.hpp>
+#include <api/softmax.hpp>
+#include <api/engine.hpp>
+#include <api/network.hpp>
#include <iostream>
pooling("pool1",
"conv1", // Input: "conv1"
pooling_mode::max, // Pooling mode: MAX
- spatial(2,2), // stride: 2
- spatial(2,2) // kernel_size: 2
+ tensor(spatial(2,2)), // stride: 2
+ tensor(spatial(2,2)) // kernel_size: 2
)
);
// Input layout for conv2 weights. Data will passed by network::set_input_data()
input_layout("conv2_weights", conv2_weights_layout),
// Input layout for conv2 bias.
- input_layout("conv2_bias", { data_type, format::bfyx, spatial(conv2_out_channels) }),
+ input_layout("conv2_bias", { data_type, format::bfyx, tensor(spatial(conv2_out_channels)) }),
// Second convolution id: "conv2"
convolution("conv2",
"pool1", // Input: "pool1"
pooling("pool2",
"conv2", // Input: "conv2"
pooling_mode::max, // Pooling mode: MAX
- spatial(2, 2), // stride: 2
- spatial(2, 2) // kernel_size: 2
+ tensor(spatial(2, 2)), // stride: 2
+ tensor(spatial(2, 2)) // kernel_size: 2
),
// Fully connected (inner product) primitive id "fc1"
fully_connected("fc1",
"pool2", // Input: "pool2"
"fc1_weights", // "fc1_weights" will be added to the topology later
- "fc1_bias", // will be defined later
- true // Use built-in Relu. Slope is set to 0 by default.
+ "fc1_bias" // will be defined later
),
// Second FC/IP primitive id: "fc2", input: "fc1".
// Weights ("fc2_weights") and biases ("fc2_bias") will be defined later.
cldnn::engine engine;
// Create memory for conv1 bias
- layout conv1_bias_layout(data_type, format::bfyx, spatial(20));
+ layout conv1_bias_layout(data_type, format::bfyx, tensor(spatial(20)));
// Memory allocation requires engine
auto conv1_bias_mem = memory::allocate(engine, conv1_bias_layout);
// The memory is allocated by library, so we do not need to care about buffer lifetime.
// Build the network. Allow implicit data optimizations.
// The "softmax" primitive is not used as an input for other primitives,
// so we do not need to explicitly select it in build_options::outputs()
- cldnn::network network(engine, topology, { build_option::optimize_data(true) });
+ cldnn::build_options options;
+ options.set_option(cldnn::build_option::optimize_data(true));
+ cldnn::network network(engine, topology, options);
// Set network data which was not known at topology creation.
network.set_input_data("conv2_weights", load_mem(engine, "conv2_weights.data"));
*/
#include <initializer_list>
-#include <../api/CPP/cldnn_defs.h>
-#include <../api/CPP/memory.hpp>
+#include <../api/memory.hpp>
* @subpage c8 <br>
*
*/
-#include <../api/CPP/engine.hpp>
-#include <../api/CPP/topology.hpp>
+#include <../api/engine.hpp>
+#include <../api/topology.hpp>
cldnn::engine chapter_1(); // Engine, layout, tensor, memory, data and input