jsc::chunk_evenly Range Adaptor for Distributing Work Across Tasks
Slice me jsc: :chunk_evenl Mateusz Zych, lvo Kabadshow Julich Supercomputing Centre, Research Centre Julich, Germany (0) How to chunk a sequence? > Different range adaptors dividing a range into subranges available: std: :Views: :chunk(chunk_size) std: :Views: :chunk_by(Predicate) std::Views::SpPlLit(dqelimiter) ve [LS Le LT LS LIALBIC index 3456789140 1 12 chunk size =5 1121s1aslsl7lsls none work across taskSs chunk count = 5 @xe9 昌 xxe9 回回 回回日回 chunk size =5 remainder 回回 chunk count = 5 由remainder 5 quotient chunk size quotient GD chunk by size [0.5][67]0 码力 | 1 页 | 1.38 MB | 5 月前3What's Eating my RAM?
shared among one or more threads Heap: a contiguous region of memory subdivided into chunks Chunk: a range of memory of various sizes allocated to the applicationHow does my code impact memory usage shared among one or more threads Heap: a contiguous region of memory subdivided into chunks Chunk: a range of memory of various sizes allocated to the applicationHow does my code impact memory usage shared among one or more threads Heap: a contiguous region of memory subdivided into chunks Chunk: a range of memory of various sizes allocated to the applicationHow does my code impact memory usage0 码力 | 88 页 | 3.49 MB | 5 月前3Adventures in SIMD Thinking (Part 2 of 2)
void UtfUtils::ConvertAsciiWithSse(char8_t const*& pSrc, char32_t*& pDst) noexcept { __m128i chunk, half, qrtr, zero; //- SSE “registers” int32_t mask, incr; //- Zero out the interleave register chunk = _mm_loadu_si128((__m128i const*) pSrc); //- Load a register with 8-bit values mask = _mm_movemask_epi8(chunk); //- Find the octets with high high bit set half = _mm_unpacklo_epi8(chunk, zero); //- Unpack bytes 0-7 into 16-bit words qrtr = _mm_unpacklo_epi16(half, zero); //- Unpack words 0-3 into 32-bit dwords _mm_storeu_si128((__m128i*)0 码力 | 135 页 | 551.08 KB | 5 月前3Tornado 6.0 Documentation
convert_yielded(self.fetch_next_chunk()) while True: chunk = yield fetch_future if chunk is None: break self.write(chunk) fetch_future = convert_yielded(self.fetch_next_chunk()) yield fetch_future = self.fetch_next_chunk() while True: chunk = yield fetch_future if chunk is None: break self.write(chunk) fetch_future = self.fetch_next_chunk() yield self.flush() those methods are called, so the values are available during prepare. RequestHandler.data_received(chunk: bytes) → Optional[Awaitable[None]] [source] Implement this method to handle streamed request data0 码力 | 869 页 | 692.83 KB | 1 年前3Tornado 6.1 Documentation
convert_yielded(self.fetch_next_chunk()) while True: chunk = yield fetch_future if chunk is None: break self.write(chunk) fetch_future = convert_yielded(self.fetch_next_chunk()) yield fetch_future = self.fetch_next_chunk() while True: chunk = yield fetch_future if chunk is None: break self.write(chunk) fetch_future = self.fetch_next_chunk() yield self.flush() those methods are called, so the values are available during prepare. RequestHandler.data_received(chunk: bytes) → Optional[Awaitable[None]] [source] Implement this method to handle streamed request data0 码力 | 931 页 | 708.03 KB | 1 年前3Back To Basics: Functional Programming in C++
composition? 1 Split the list into multiple chunks of increasing numbers. 2 Determine the size of each chunk. 3 Return the maximum. Jonathan Müller — @foonathan Back to Basics: Functional Programming in C++ longest_increasing_subsequence(auto&& rng) { return stdr::max( rng // [1, 3, 2, 4, 5, 7, 6] | stdv::chunk_by(std::less{}) // [[1, 3], [2, 4, 5, 7], [6]] | stdv::transform(stdr::size) // [2, 4, 1] ); 2024-09-19 34Composition shape: Range → range of ranges Input Range Output Range of ranges stdv::chunk_by: split the range into chunks where borders don’t satisfy a binary predicate Jonathan Müller — 0 码力 | 178 页 | 918.67 KB | 5 月前3Falcon v3.0.0-b1 Documentation
import io import os import uuid import mimetypes import falcon import msgpack class Resource: _CHUNK_SIZE_BYTES = 4096 # The resource object must now be initialized with a path used during POST while True: chunk = req.stream.read(self._CHUNK_SIZE_BYTES) if not chunk: break image_file.write(chunk) resp.status = falcon resp.status = falcon.HTTP_201 resp.location = '/images/' + name class ImageStore: _CHUNK_SIZE_BYTES = 4096 # Note the use of dependency injection for standard library # methods. We'll0 码力 | 1028 页 | 725.86 KB | 1 年前3Falcon v3.0.0 Documentation
import io import os import uuid import mimetypes import falcon import msgpack class Resource: _CHUNK_SIZE_BYTES = 4096 # The resource object must now be initialized with a path used during POST while True: chunk = req.stream.read(self._CHUNK_SIZE_BYTES) if not chunk: break image_file.write(chunk) resp.status = falcon resp.status = falcon.HTTP_201 resp.location = '/images/' + name class ImageStore: _CHUNK_SIZE_BYTES = 4096 # Note the use of dependency injection for standard library # methods. We'll0 码力 | 1055 页 | 739.30 KB | 1 年前3Falcon v3.0.1 Documentation
import io import os import uuid import mimetypes import falcon import msgpack class Resource: _CHUNK_SIZE_BYTES = 4096 # The resource object must now be initialized with a path used during POST while True: chunk = req.stream.read(self._CHUNK_SIZE_BYTES) if not chunk: break image_file.write(chunk) resp.status = falcon resp.status = falcon.HTTP_201 resp.location = '/images/' + name class ImageStore: _CHUNK_SIZE_BYTES = 4096 # Note the use of dependency injection for standard library # methods. We'll0 码力 | 1058 页 | 741.59 KB | 1 年前3Falcon v3.0.0-b2 Documentation
import io import os import uuid import mimetypes import falcon import msgpack class Resource: _CHUNK_SIZE_BYTES = 4096 # The resource object must now be initialized with a path used during POST while True: chunk = req.stream.read(self._CHUNK_SIZE_BYTES) if not chunk: break image_file.write(chunk) resp.status = falcon resp.status = falcon.HTTP_201 resp.location = '/images/' + name class ImageStore: _CHUNK_SIZE_BYTES = 4096 # Note the use of dependency injection for standard library # methods. We'll0 码力 | 1041 页 | 730.21 KB | 1 年前3
共 548 条
- 1
- 2
- 3
- 4
- 5
- 6
- 55