FUTHARK-DATASET(1)

πŸ“¦
version 0.25.32 Β· 5 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– FUTHARK-DATASET πŸ’–

okay so bestie, welcome to futhark-dataset, part of the Futhark manual, section 1 πŸŽ€. literally the moment you've been waiting for.


✨ NAME ✨

futhark-dataset β€” generate random data sets 🎲


🌸 SYNOPSIS 🌸

futhark dataset [options...]

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically, this thing makes random values in Futhark syntax, and that is so useful when you need to whip up input datasets for testing your programs. iconic.

  • all Futhark primitive types? supported, no cap πŸ’…
  • tuples? not supported πŸ™ˆ sorry bestie
  • arrays of specific (non-random) sizes? yes, you can generate those πŸ‘‘
  • you can set maximum and minimum bounds on values ✨
  • and you can set the random seed used when generating the data πŸŽ€

whatever it generates gets written straight to standard output 🫢

okay and here's the other mode: if you pass no -g/--generate options, then values get read from standard input and printed to standard output in whatever format you indicated. the input format β€” textual or binary β€” is automatically detected. it just knows 😭

⚠️ and it returns a nonzero exit code if it fails to write the full output. so like, watch for that.

πŸ’œ OPTIONS πŸ’œ

  • -b, --binary β€” output data in binary Futhark format. must come before --generate bestie, order matters 🫢
  • -g type, --generate type β€” generate a value of the indicated type, e.g. -g i32 or -g [10]f32. and plot twist: the type can also be an actual literal value, and then that literal value is what gets generated ⭐
  • -s int β€” set the seed used for the RNG. it's 1 by default 🎲
  • --T-bounds=<min:max> β€” set inclusive lower and upper bounds on generated values of type T. T is any primitive type, e.g. i32 or f32. and the way that these bounds apply to any following uses of the -g option… πŸ’…
  • --text β€” output data in text format (must precede --generate). this is the default ✨
  • -t, --type β€” output the types of the values (textually) instead of the values themselves. mostly useful when you're reading values on stdin πŸ‘‘

also, tiny lil heads up: you can alter the output format using the following flags β€” to use them, add them before data generation (--generate) πŸ™ˆ (yes that's --text, -t/--type, and -b/--binary up there, they're all in on the same bit)


πŸ”₯ EXAMPLES πŸ”₯

generate a 4 by 2 integer matrix:

futhark dataset -g [4][2]i32

generate an array of floating-point numbers and an array of indices into that array:

futhark dataset -g [10]f32 --i64-bounds=0:9 -g [100]i64

to generate binary data, the --binary must come before the --generate:

futhark dataset --binary --generate=[42]i32

create a binary data file from a data file:

futhark dataset --binary < any_data > binary_data

determine the types of values contained in a data file:

futhark dataset -t < any_data

🌈 SEE ALSO 🌈

  • futhark-test <#futhark-test-1>
  • futhark-bench <#futhark-bench-1>

2013-2020, DIKU, University of Copenhagen


aaaand that's the whole page bestie πŸ’– version 0.25.32, dated Mar 11, 2026. go generate something cute βœ¨πŸ§šπŸ’…

πŸ“¦ where this page comes from