cuda.js
Version:
CUDA bindings for Node.js
37 lines • 903 B
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Stream = void 0;
const native_1 = __importDefault(require("./native"));
const cuda_1 = require("./cuda");
/**
* CUDA stream wrapper for asynchronous operations
*/
class Stream {
constructor() {
cuda_1.Cuda.init();
this.id = native_1.default.createStream();
}
/**
* Synchronize the stream
*/
synchronize() {
native_1.default.synchronizeStream(this.id);
}
/**
* Get stream ID for internal use
*/
getId() {
return this.id;
}
/**
* Free stream resources
*/
free() {
native_1.default.freeStream(this.id);
}
}
exports.Stream = Stream;
//# sourceMappingURL=stream.js.map
;