public void Setup()
        {
            _platformId = GetPlatforms().First();
            _contextId  = CreateContext(_platformId);

            _poolRent   = new OclMemoryPool();
            _poolReturn = new OclMemoryPool();

            _bufferId = CreateBuffer <int>(_contextId, 1024);
        }
        public void Can_Rent_miss()
        {
            using var pool = new OclMemoryPool();

            var platformId = GetPlatforms().First();
            var contextId  = CreateContext(platformId);

            // Act:
            var bufferId = pool.RentBuffer <int>(contextId, 1024);

            ReleaseMemObject(bufferId);
        }
        public void Can_Rent_hit()
        {
            using var pool = new OclMemoryPool();

            var platformId = GetPlatforms().First();
            var contextId  = CreateContext(platformId);
            var bufferId   = CreateBuffer <int>(contextId, 1024);

            pool.ReturnBuffer(bufferId);

            // Act:
            var rentedId = pool.RentBuffer <int>(contextId, 1024);

            rentedId.Should().Be(bufferId);

            ReleaseMemObject(bufferId);
        }
 public void Create()
 {
     using var pool = new OclMemoryPool();
 }