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 Return_and_Rent()
 {
     _poolReturn.ReturnBuffer(_bufferId);
     _poolReturn.RentBuffer <int>(_contextId, 1024);
 }
        public void Rent_miss()
        {
            var bufferId = _poolRent.RentBuffer <int>(_contextId, 1024);

            ReleaseMemObject(bufferId);
        }