File: futhark-dataset.rst

package info (click to toggle)
haskell-futhark 0.25.32-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 18,236 kB
  • sloc: haskell: 100,484; ansic: 12,100; python: 3,440; yacc: 785; sh: 561; javascript: 558; lisp: 399; makefile: 277
file content (89 lines) | stat: -rw-r--r-- 2,366 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
.. role:: ref(emphasis)

.. _futhark-dataset(1):

===============
futhark-dataset
===============

SYNOPSIS
========

futhark dataset [options...]

DESCRIPTION
===========

Generate random values in Futhark syntax, which can be useful when
generating input datasets for program testing.  All Futhark primitive
types are supported.  Tuples are not supported.  Arrays of specific
(non-random) sizes can be generated.  You can specify maximum and
minimum bounds for values, as well as the random seed used when
generating the data.  The generated values are written to standard
output.

If no ``-g``/``--generate`` options are passed, values are read from
standard input, and printed to standard output in the indicated
format.  The input format (whether textual or binary) is automatically
detected.

Returns a nonzero exit code if it fails to write the full output.

OPTIONS
=======

-b, --binary
  Output data in binary Futhark format (must precede --generate).

-g type, --generate type
  Generate a value of the indicated type, e.g. ``-g i32`` or ``-g [10]f32``.

  The type may also be a value, in which case that literal value is
  generated.

-s int
  Set the seed used for the RNG.  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``.  The
  bounds apply to any following uses of the ``-g`` option.

You can alter the output format using the following flags. To use them, add them
before data generation (--generate):

--text
  Output data in text format (must precede --generate). Default.

-t, --type
  Output the types of values (textually) instead of the values
  themselves.  Mostly useful when reading values on stdin.

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
========

:ref:`futhark-test(1)`, :ref:`futhark-bench(1)`