Пример #1
0
    private IEnumerable CheckBurstJobDisabled()
    {
        BurstCompiler.Options.EnableBurstCompilation = false;

        yield return(null);

        using (var jobTester = new BurstJobTester())
        {
            var result = jobTester.Calculate();
            Assert.AreEqual(0.0f, result);
        }
    }
Пример #2
0
    public IEnumerator CheckBurstFunctionPointerException()
    {
        BurstCompiler.Options.EnableBurstCompileSynchronously = true;
        BurstCompiler.Options.EnableBurstCompilation          = true;

        yield return(null);

        using (var jobTester = new BurstJobTester())
        {
            var exception = Assert.Throws <InvalidOperationException>(() => jobTester.CheckFunctionPointer());
            StringAssert.Contains("Exception was thrown from a function compiled with Burst", exception.Message);
        }
    }
Пример #3
0
    public IEnumerator CheckBurstJobDisabled()
    {
        JobsUtility.JobCompilerEnabled = false;

        yield return(null);

        yield return(null);

        yield return(null);

        yield return(null);

        yield return(null);

        using (var jobTester = new BurstJobTester())
        {
            var result = jobTester.Calculate();
            Assert.AreEqual(0.0f, result);
        }
    }
Пример #4
0
    public IEnumerator CheckBurstJobEnabled()
    {
        JobsUtility.JobCompilerEnabled = true;
//        BurstCompiler.Options.EnableBurstCompileSynchronously = true;
        yield return(null);

        yield return(null);

        yield return(null);

        yield return(null);

        yield return(null);

        using (var jobTester = new BurstJobTester())
        {
            var result = jobTester.Calculate();
            Assert.AreNotEqual(0.0f, result);
        }
    }