Shortcuts

Program Listing for File mps.h

Return to documentation for file (torch/csrc/api/include/torch/mps.h)

#pragma once

#include <torch/csrc/Export.h>

#include <cstddef>
#include <cstdint>

#ifdef __OBJC__
#include <Foundation/Foundation.h>
#include <Metal/Metal.h>
using MTLCommandBuffer_t = id<MTLCommandBuffer>;
using DispatchQueue_t = dispatch_queue_t;
#else
using MTLCommandBuffer_t = void*;
using DispatchQueue_t = void*;
#endif

namespace torch {
namespace mps {

bool TORCH_API is_available();

void TORCH_API manual_seed(uint64_t seed);

void TORCH_API synchronize();

void TORCH_API commit();

MTLCommandBuffer_t TORCH_API get_command_buffer();

DispatchQueue_t TORCH_API get_dispatch_queue();

} // namespace mps
} // namespace torch

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources