Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/ldyken53/TVCG-progiso
31 October 2024, 16:40:01 UTC
  • Code
  • Branches (3)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/main
    • refs/heads/master
    • refs/heads/npm
    No releases to show
  • 1eea666
  • /
  • src
  • /
  • util.js
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:3a4d3e5f77fa50d7983cd55105a8aa944573f4c8
origin badgedirectory badge
swh:1:dir:90adcc85fa05854bbd02b1e6c15cfc58d839ce1e
origin badgerevision badge
swh:1:rev:f93ee0c2285e5a4cfe5962a28ceb12cf0ce15352
origin badgesnapshot badge
swh:1:snp:6dbeb1fbe859f48945dd22bd530e60eb1a5ac9b6

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: f93ee0c2285e5a4cfe5962a28ceb12cf0ce15352 authored by Landon Dyken on 17 October 2024, 22:37:18 UTC
Update README.md
Tip revision: f93ee0c
util.js
// Generate the work group ID offset buffer and the dynamic offset buffer to use for chunking
// up a large compute dispatch. The start of the push constants data will be:
// {
//      u32: global work group id offset
//      u32: totalWorkGroups
//      ...: up to 248 bytes additional data (if any) from the pushConstants parameter,
//           passed as an ArrayBuffer or TypedArray
// }
// ID offset (u32),
export function buildPushConstantsBuffer(device, totalWorkGroups, pushConstants)
{
    var dynamicOffsets = [];
    var dispatchSizes = [];

    var numDynamicOffsets =
        Math.ceil(totalWorkGroups / device.limits.maxComputeWorkgroupsPerDimension);
    var idOffsetsBuffer = device.createBuffer({
        size: 256 * numDynamicOffsets,
        usage: GPUBufferUsage.UNIFORM,
        mappedAtCreation: true,
    });
    {
        var pushConstantsView = null;
        if (pushConstants) {
            var pc = pushConstants;
            if (pushConstants.buffer) {
                pc = pushConstants.buffer;
            }
            if (pc.byteLength > 248) {
                console.log(`Error: push constants can be at most 248 bytes`);
            }
            pushConstantsView = new Uint8Array(pc);
        }
        var mapping = idOffsetsBuffer.getMappedRange();
        for (var i = 0; i < numDynamicOffsets; ++i) {
            dynamicOffsets.push(i * 256);

            if (i + 1 < numDynamicOffsets) {
                dispatchSizes.push(device.limits.maxComputeWorkgroupsPerDimension);
            } else {
                dispatchSizes.push(totalWorkGroups %
                                   device.limits.maxComputeWorkgroupsPerDimension);
            }

            // Write the push constants data
            var u32view = new Uint32Array(mapping, i * 256, 2);
            u32view[0] = device.limits.maxComputeWorkgroupsPerDimension * i;
            u32view[1] = totalWorkGroups;

            // Copy in any additional push constants data if provided
            if (pushConstantsView) {
                var u8view = new Uint8Array(mapping, i * 256 + 8, 248);
                u8view.set(pushConstantsView);
            }
        }
        idOffsetsBuffer.unmap();
    }
    dynamicOffsets = new Uint32Array(dynamicOffsets);

    return {
        nOffsets: numDynamicOffsets,
        gpuBuffer: idOffsetsBuffer,
        dynamicOffsets: dynamicOffsets,
        dispatchSizes: dispatchSizes,
    };
}

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API