std1.0.0-beta-7 SafeC docs

std :: ml::gpu_cudnn

Struct std::CudaUNet

#include <std/ml/gpu_cudnn.h> source

struct CudaUNet {
    struct CudaConv2D encConv1;
    struct CudaConv2D encConv2;
    struct CudaConv2D bottleneck;
    struct CudaConv2D decConv1;
    struct CudaConv2D decConv2;
    struct CudaBuf e1;
    struct CudaBuf p1;
    struct CudaBuf e2;
    struct CudaBuf p2;
    struct CudaBuf mid;
    struct CudaBuf up;
    struct CudaBuf cat1;
    struct CudaBuf d1;
    struct CudaBuf cat2;
    unsigned long batch;
    unsigned long height;
    unsigned long width;
    int ok;
}

Weights plus every intermediate activation, sized once for a fixed batch x height x width, so a forward pass allocates nothing.

Fields

§struct CudaConv2D encConv1source
§struct CudaConv2D encConv2source
§struct CudaConv2D bottlenecksource
§struct CudaConv2D decConv1source
§struct CudaConv2D decConv2source
§struct CudaBuf e1source

[B, c1, H, W]

§struct CudaBuf p1source

[B, c1, H/2, W/2]

§struct CudaBuf e2source

[B, c2, H/2, W/2]

§struct CudaBuf p2source

[B, c2, H/4, W/4]

§struct CudaBuf midsource

[B, c2, H/4, W/4]

§struct CudaBuf upsource

[B, c2, H/2, W/2], reused for [B, c1, H, W]

§struct CudaBuf cat1source

[B, 2*c2, H/2, W/2]

§struct CudaBuf d1source

[B, c1, H/2, W/2]

§struct CudaBuf cat2source

[B, 2*c1, H, W]

§unsigned long batchsource
§unsigned long heightsource
§unsigned long widthsource
§int oksource

0 if an upload or allocation failed

Methods

§int forward(struct CudaBuf x, struct CudaBuf y) constsource · definition

y: [batch, outChannels, height, width]. Queued, like the ops above.

§void free()source · definition
§static struct CudaUNet new( const &UNet net, unsigned long batch, unsigned long height, unsigned long width, )source · definition

height and width must each be divisible by 4.