Tasks (Polyglot)¶
In [ ]:
//// test
open testing
task_name¶
In [ ]:
nominal task_name = string
manual_scheduling¶
In [ ]:
union manual_scheduling =
| WithSuggestion
| WithoutSuggestion
recurrency_offset¶
In [ ]:
union recurrency_offset =
| Days : i32
| Weeks : i32
| Months : i32
day_of_week¶
In [ ]:
union day_of_week =
| Sunday
| Monday
| Tuesday
| Wednesday
| Thursday
| Friday
| Saturday
month¶
In [ ]:
union month =
| January
| February
| March
| April
| May
| June
| July
| August
| September
| October
| November
| December
day¶
In [ ]:
nominal day = i32
year¶
In [ ]:
nominal year = i32
fixed_recurrency¶
In [ ]:
union fixed_recurrency =
| Weekly : day_of_week
| Monthly : day
| Yearly : day * month
recurrency¶
In [ ]:
union recurrency =
| Offset : recurrency_offset
| Fixed : list fixed_recurrency
scheduling¶
In [ ]:
union scheduling =
| Manual : manual_scheduling
| Recurrent : recurrency
task¶
In [ ]:
type task =
{
name : task_name
scheduling : scheduling
}
date¶
In [ ]:
type date =
{
year : year
month : month
day : day
}
status¶
In [ ]:
union status =
| Postponed : option ()
event¶
In [ ]:
type event =
{
date : date
status : status
}
task_template¶
In [ ]:
type task_template =
{
task : task
events : list event
}
get_tasks (test)¶
In [ ]:
//// test
inl get_tasks () : list task_template =
[
{
task =
{
name = task_name "01"
scheduling = Manual WithSuggestion
}
events = []
}
{
task =
{
name = task_name "02"
scheduling = Manual WithSuggestion
}
events = []
}
{
task =
{
name = task_name "03"
scheduling = Manual WithSuggestion
}
events = []
}
]
In [ ]:
//// test
///! fsharp
///! cuda
///! rust
///! typescript
///! python
get_tasks ()
|> sm'.format_debug
|> _assert sm'.contains "01"
.py output (Cuda): __assert / actual: 01 / expected: UH2_1(v0='01', v1=US1_0(v0=US0_0()), v2=UH1_0(), v3=UH2_1(v0='02', v1=US1_0(v0=US0_0()), v2=UH1_0(), v3=UH2_1(v0='03', v1=US1_0(v0=US0_0()), v2=UH1_0(), v3=UH2_0()))) Traceback (most recent call last): File "cupy/cuda/stream.pyx", line 36, in cupy.cuda.stream._ThreadLocal.get AttributeError: '_thread._local' object has no attribute 'tls' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/d99a5bfcf2eade8bd1c47a64e27398ed76ca04dd35f96742c97db57c1b199372/main.py", line 223, in <module> if __name__ == '__main__': result = main(); None if result is None else print(result) ^^^^^^ File "/home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/d99a5bfcf2eade8bd1c47a64e27398ed76ca04dd35f96742c97db57c1b199372/main.py", line 220, in main cp.cuda.get_current_stream().synchronize() # This line is here so the `__trap()` calls on the kernel aren't missed. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "cupy/cuda/stream.pyx", line 87, in cupy.cuda.stream.get_current_stream File "cupy/cuda/stream.pyx", line 96, in cupy.cuda.stream.get_current_stream File "cupy/cuda/stream.pyx", line 38, in cupy.cuda.stream._ThreadLocal.get File "cupy/cuda/stream.pyx", line 24, in cupy.cuda.stream._ThreadLocal.__init__ File "cupy_backends/cuda/api/runtime.pyx", line 393, in cupy_backends.cuda.api.runtime.getDeviceCount File "cupy_backends/cuda/api/runtime.pyx", line 146, in cupy_backends.cuda.api.runtime.check_status cupy_backends.cuda.api.runtime.CUDARuntimeError: cudaErrorInsufficientDriver: CUDA driver version is insufficient for CUDA runtime version .rs output: __assert / actual: "01" / expected: "UH2_1("01", US1_0(US0_0), UH1_0, UH2_1("02", US1_0(US0_0), UH1_0, UH2_1("03", US1_0(US0_0), UH1_0, UH2_0)))" .ts output: __assert / actual: 01 / expected: UH2_1 (01, US1_0 US0_0, UH1_0, UH2_1 (02, US1_0 US0_0, UH1_0, UH2_1 (03, US1_0 US0_0, UH1_0, UH2_0))) .py output: __assert / actual: 01 / expected: UH2_1 ("01", US1_0 US0_0, UH1_0, UH2_1 ("02", US1_0 US0_0, UH1_0, UH2_1 ("03", US1_0 US0_0, UH1_0, UH2_0)))
.fsx output: __assert / actual: "01" / expected: "UH2_1 ("01", US1_0 US0_0, UH1_0, UH2_1 ("02", US1_0 US0_0, UH1_0, UH2_1 ("03", US1_0 US0_0, UH1_0, UH2_0)))"
In [ ]:
//// test
///! fsharp
///! cuda
///! rust
///! typescript
///! python
get_tasks ()
|> listm'.try_item 0i32
|> fun (Some task) => task.task.name
|> _assert_eq (task_name "01")
.py output (Cuda): Traceback (most recent call last): __assert_eq / actual: 01 / expected: 01 File "cupy/cuda/stream.pyx", line 36, in cupy.cuda.stream._ThreadLocal.get AttributeError: '_thread._local' object has no attribute 'tls' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a2febb984386b511fb9fd61c6cc6d95e8657dd901e167bae3e086dc4876fe69a/main.py", line 71, in <module> if __name__ == '__main__': result = main(); None if result is None else print(result) ^^^^^^ File "/home/runner/work/polyglot/polyglot/target/spiral_Eval/packages/a2febb984386b511fb9fd61c6cc6d95e8657dd901e167bae3e086dc4876fe69a/main.py", line 68, in main cp.cuda.get_current_stream().synchronize() # This line is here so the `__trap()` calls on the kernel aren't missed. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "cupy/cuda/stream.pyx", line 87, in cupy.cuda.stream.get_current_stream File "cupy/cuda/stream.pyx", line 96, in cupy.cuda.stream.get_current_stream File "cupy/cuda/stream.pyx", line 38, in cupy.cuda.stream._ThreadLocal.get File "cupy/cuda/stream.pyx", line 24, in cupy.cuda.stream._ThreadLocal.__init__ File "cupy_backends/cuda/api/runtime.pyx", line 393, in cupy_backends.cuda.api.runtime.getDeviceCount File "cupy_backends/cuda/api/runtime.pyx", line 146, in cupy_backends.cuda.api.runtime.check_status cupy_backends.cuda.api.runtime.CUDARuntimeError: cudaErrorInsufficientDriver: CUDA driver version is insufficient for CUDA runtime version .rs output: __assert_eq / actual: "01" / expected: "01" .ts output: __assert_eq / actual: 01 / expected: 01 .py output: __assert_eq / actual: 01 / expected: 01
.fsx output: __assert_eq / actual: "01" / expected: "01"