std1.0.0-beta-7 SafeC docs

std :: ml::gpu_miopen

Struct std::RocmUNet

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

struct RocmUNet {
    struct RocmConv2D encConv1;
    struct RocmConv2D encConv2;
    struct RocmConv2D bottleneck;
    struct RocmConv2D decConv1;
    struct RocmConv2D decConv2;
    struct RocmBuf e1;
    struct RocmBuf p1;
    struct RocmBuf e2;
    struct RocmBuf p2;
    struct RocmBuf mid;
    struct RocmBuf cat1;
    struct RocmBuf d1;
    struct RocmBuf 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. Each decoder step upsamples straight into its concat buffer (rocm_upsample2x_concat).

Fields

§struct RocmConv2D encConv1source
§struct RocmConv2D encConv2source
§struct RocmConv2D bottlenecksource
§struct RocmConv2D decConv1source
§struct RocmConv2D decConv2source
§struct RocmBuf e1source

[B, c1, H, W]

§struct RocmBuf p1source

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

§struct RocmBuf e2source

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

§struct RocmBuf p2source

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

§struct RocmBuf midsource

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

§struct RocmBuf cat1source

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

§struct RocmBuf d1source

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

§struct RocmBuf 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 RocmBuf x, struct RocmBuf y) constsource · definition

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

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

height and width must each be divisible by 4.