34 std::string
string = os.str();
35 return NS::String::string(
string.c_str(), NS::UTF8StringEncoding);
40 std::ostringstream label;
41 label <<
"Stream " << index;
47 MTL::CommandBuffer* command_buffer,
50 std::ostringstream label;
51 if (
auto cbuf_label = command_buffer->label(); cbuf_label) {
52 label << cbuf_label->utf8String();
54 primitive.
print(label);
66template <
typename T,
typename...
Args>
Definition primitives.h:48
virtual void print(std::ostream &os)=0
Print the primitive.
const Flags & flags() const
Get the Flags bit-field.
Definition array.h:318
const Shape & shape() const
The shape of the array as a vector of integers.
Definition array.h:103
const Strides & strides() const
The strides of the array.
Definition array.h:117
allocator::Buffer & buffer()
Definition array.h:336
Dtype dtype() const
Get the arrays data type.
Definition array.h:131
size_t data_size() const
The size (in elements) of the underlying buffer the array points to.
Definition array.h:332
MTL::Size get_block_dims(int dim0, int dim1, int dim2, int pow2=10)
array unsafe_weak_copy(const array &x)
Get a new array that refers to the same data but has a non-owning pointer to them.
Definition utils.h:76
void debug_set_primitive_buffer_label(MTL::CommandBuffer *command_buffer, Primitive &primitive)
Definition utils.h:46
std::vector< ShapeElem > Shape
Definition array.h:21
void concatenate(std::string &acc, T first)
Definition utils.h:62
void debug_set_stream_queue_label(MTL::CommandQueue *queue, int index)
Definition utils.h:38
std::vector< int64_t > Strides
Definition array.h:22
MTL::Size get_2d_grid_dims(const Shape &shape, const Strides &strides)
std::vector< array > Args
Definition export.h:11
std::string get_primitive_string(Primitive *primitive)
NS::String * make_string(std::ostringstream &os)
Definition utils.h:33
std::string type_to_name(const Dtype &t)