public Test(ComputeType computingType, PortDescription.Category traversalCategory)
 {
     Cache     = new Topology.TraversalCache(0, (uint)traversalCategory);
     Nodes     = new NativeList <NodeHandle <TNodeType> >(10, Allocator.Temp);
     Set       = new NodeSet();
     m_Options = Topology.CacheAPI.ComputationOptions.Create(computeJobified: computingType == ComputeType.Jobified);
 }
Пример #2
0
        private void CallInternalComputeTypes(ComputeType type, object dep)
        {
            try
            {
                switch (type)
                {
                case ComputeType.IaaS:
                    ExecuteAllActionsForIaaS((ARMDeployment)dep);
                    break;

                case ComputeType.VMSS:
                    ExecuteAllActionsForVMSS((ARMDeployment)dep);
                    break;

                case ComputeType.PaaS:
                    ExecuteAllActionsForPaaS((RDFEDeployment)dep);
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                Log.Error("Failed to run Compute type {0}.", type);
                Log.Exception(ex);
            }
        }
 public Test(ComputeType computingType)
 {
     Cache     = new Topology.TraversalCache(0, Topology.TraversalCache.TraverseAllMask);
     Nodes     = new NativeList <NodeHandle <TNodeType> >(10, Allocator.Temp);
     Set       = new NodeSet();
     m_Options = Topology.CacheAPI.ComputationOptions.Create(computeJobified: computingType == ComputeType.Jobified);
 }
Пример #4
0
 internal AksComputeSecrets(ComputeType computeType, string userKubeConfig, string adminKubeConfig, string imagePullSecretName) : base(computeType)
 {
     UserKubeConfig      = userKubeConfig;
     AdminKubeConfig     = adminKubeConfig;
     ImagePullSecretName = imagePullSecretName;
     ComputeType         = computeType;
 }
 internal ComputeTypeGetResponse(
     CoreRegistrationModel.ComputeTypeGetResponse internalResponse,
     DataFactoryManagementClient client)
     : this()
 {
     DataFactoryOperationUtilities.CopyRuntimeProperties(internalResponse, this);
     this.ComputeType = ((ComputeTypeOperations)client.ComputeTypes).Converter.ToWrapperType(internalResponse.ComputeType);
 }
Пример #6
0
 public Test(Topology.SortingAlgorithm algo, ComputeType computingType, uint traversalMask, uint alternateMask)
 {
     Cache        = new Topology.TraversalCache(0, traversalMask, alternateMask);
     Nodes        = new NativeList <Node>(10, Allocator.Temp);
     TestDatabase = new TopologyTestDatabase(Allocator.Temp);
     m_Options    = Topology.CacheAPI.ComputationOptions.Create(computeJobified: computingType == ComputeType.Jobified);
     Version      = Topology.CacheAPI.VersionTracker.Create();
     m_Algorithm  = algo;
 }
        public void ChangeUpdateMethodWithClear(UpdateMethodType type, bool needsImmediately = false)
        {
            ChangeUpdateMethod(type);
            ClearMatrices();
            DisableAllParticles();

            ComputeType computeType = needsImmediately ? ComputeType.SetupImmediately : ComputeType.Setup;

            UpdateAllBuffers(computeType);
            Dispatch(computeType);
        }
Пример #8
0
        public void TestInternalIndices([Values] Topology.SortingAlgorithm algo, [Values] ComputeType jobified)
        {
            using (var test = new Test(algo, jobified))
            {
                var node1 = test.TestDatabase.CreateNode();
                var node2 = test.TestDatabase.CreateNode();
                var node3 = test.TestDatabase.CreateNode();

                test.Nodes.Add(node1);
                test.Nodes.Add(node2);
                test.Nodes.Add(node3);

                Assert.DoesNotThrow(() => test.TestDatabase.Connect(node2, k_OutputOne, node1, k_InputOne));
                Assert.DoesNotThrow(() => test.TestDatabase.Connect(node3, k_OutputOne, node1, k_InputThree));

                var entryIndex = 0;

                foreach (var node in test.GetWalker())
                {
                    if (entryIndex == 0 || entryIndex == 1)
                    {
                        Assert.AreEqual(0, node.GetParents().Count);
                    }
                    else
                    {
                        Assert.AreEqual(2, node.GetParents().Count);
                        foreach (var parent in node.GetParents())
                        {
                            Assert.IsTrue(parent.Vertex == node2 || parent.Vertex == node3);
                        }
                    }

                    if (entryIndex == 0 || entryIndex == 1)
                    {
                        Assert.AreEqual(1, node.GetChildren().Count);

                        foreach (var child in node.GetChildren())
                        {
                            Assert.AreEqual(node1, child.Vertex);
                        }
                    }
                    else
                    {
                        Assert.AreEqual(0, node.GetChildren().Count);
                    }

                    entryIndex++;
                }
            }
        }
Пример #9
0
        private void TestComputeTypeJson(JsonSampleInfo sampleInfo)
        {
            string      json        = sampleInfo.Json;
            ComputeType computeType = this.ConvertToWrapper(json);

            CoreRegistrationModel.ComputeType actual = this.Operations.Converter.ToCoreType(computeType);

            string actualJson = Core.DataFactoryManagementClient.SerializeInternalComputeTypeToJson(actual);

            JsonComparer.ValidateAreSame(json, actualJson, ignoreDefaultValues: true);
            Assert.False(actualJson.Contains("ServiceExtraProperties"));

            JObject actualJObject = JObject.Parse(actualJson);

            JsonComparer.ValidatePropertyNameCasing(actualJObject, true, string.Empty, sampleInfo.PropertyBagKeys);
        }
        private int GetKernelID(ComputeType type)
        {
            switch (type)
            {
            case ComputeType.Setup:
                return(_kernelSetupParticles);

            case ComputeType.SetupImmediately:
                return(_kernelSetupParticlesImmediately);

            case ComputeType.DisableAll:
                return(_kernelDisable);
            }

            return(-1);
        }
Пример #11
0
 /// <summary>
 /// Initializes a new instance of the
 /// ComputeTypeCreateOrUpdateParameters class with required
 /// arguments.
 /// </summary>
 public ComputeTypeCreateOrUpdateParameters(ComputeType computeType)
     : this()
 {
     Ensure.IsNotNull(computeType, "computeType");
     this.ComputeType = computeType;
 }
Пример #12
0
 public Test(Topology.SortingAlgorithm algo, ComputeType computingType, uint traversalMask)
     : this(algo, computingType, traversalMask, traversalMask)
 {
 }
 internal DatabricksComputeSecrets(ComputeType computeType, string databricksAccessToken) : base(computeType)
 {
     DatabricksAccessToken = databricksAccessToken;
     ComputeType           = computeType;
 }
Пример #14
0
            public Compute(string formula)
            {
                if (string.IsNullOrEmpty(formula))
                {
                    return;
                }
                myFormula = formula;
                // 检测当前节点的计算类型
                if (formula.Contains("-"))
                {
                    computeType = ComputeType.Sub;
                }
                else if (formula.Contains("+"))
                {
                    computeType = ComputeType.Plus;
                }
                else if (formula.Contains("/"))
                {
                    computeType = ComputeType.Div;
                }
                else if (formula.Contains("*"))
                {
                    computeType = ComputeType.Mult;
                }
                else
                {
                    return;
                }

                char sign = '\0';

                switch (computeType)
                {
                // 乘
                case ComputeType.Mult:
                    sign = '*';
                    break;

                // 除
                case ComputeType.Div:
                    sign = '/';
                    break;

                // 加
                case ComputeType.Plus:
                    sign = '+';
                    break;

                // 减
                case ComputeType.Sub:
                    sign = '-';
                    break;
                }

                var array = formula.Split(sign);

                foreach (var item in array)
                {
                    AddCompute(new Compute(item));
                }
            }
Пример #15
0
        public void RootAndLeafCacheWalker_WalksRootsAndLeaves([Values] Topology.SortingAlgorithm algo, [Values] ComputeType jobified)
        {
            using (var test = new Test(algo, jobified))
            {
                for (int i = 0; i < 5; ++i)
                {
                    test.Nodes.Add(test.TestDatabase.CreateNode());
                }

                test.TestDatabase.Connect(test.Nodes[0], k_OutputOne, test.Nodes[2], k_InputOne);
                test.TestDatabase.Connect(test.Nodes[1], k_OutputOne, test.Nodes[2], k_InputTwo);

                test.TestDatabase.Connect(test.Nodes[2], k_OutputOne, test.Nodes[3], k_InputOne);
                test.TestDatabase.Connect(test.Nodes[2], k_OutputTwo, test.Nodes[4], k_InputOne);

                var cache = test.GetUpdatedCache();

                Assert.AreEqual(cache.Leaves.Length, 2);
                Assert.AreEqual(cache.Roots.Length, 2);

                var roots = new List <Node>();

                for (int i = 0; i < cache.Leaves.Length; ++i)
                {
                    roots.Add(cache.OrderedTraversal[cache.Roots[i]].Vertex);
                }

                var leaves = new List <Node>();

                for (int i = 0; i < cache.Roots.Length; ++i)
                {
                    leaves.Add(cache.OrderedTraversal[cache.Leaves[i]].Vertex);
                }

                CollectionAssert.Contains(leaves, test.Nodes[0]);
                CollectionAssert.Contains(leaves, test.Nodes[1]);
                CollectionAssert.Contains(roots, test.Nodes[3]);
                CollectionAssert.Contains(roots, test.Nodes[4]);
            }
        }
Пример #16
0
        public void TraversalCache_DoesNotInclude_IgnoredTraversalTypes([Values] Topology.SortingAlgorithm algo, [Values] ComputeType computeType, [Values] TraversalType traversalType)
        {
            using (var test = new Test(algo, computeType, (uint)traversalType))
            {
                int numParents  = traversalType == TraversalType.Different ? 2 : 0;
                int numChildren = traversalType == TraversalType.Normal ? 2 : 0;

                for (int i = 0; i < 5; ++i)
                {
                    test.Nodes.Add(test.TestDatabase.CreateNode());
                }

                test.TestDatabase.Connect((uint)TraversalType.Different, test.Nodes[0], k_DifferentOutput, test.Nodes[2], k_DifferentInput);
                test.TestDatabase.Connect((uint)TraversalType.Different, test.Nodes[1], k_DifferentOutput, test.Nodes[2], k_DifferentInput);

                test.TestDatabase.Connect((uint)TraversalType.Normal, test.Nodes[2], k_OutputOne, test.Nodes[3], k_InputOne);
                test.TestDatabase.Connect((uint)TraversalType.Normal, test.Nodes[2], k_OutputOne, test.Nodes[4], k_InputOne);

                bool centerNodeWasFound = false;

                foreach (var node in test.GetWalker())
                {
                    if (node.Vertex == test.Nodes[2])
                    {
                        Assert.AreEqual(0, node.GetParentsByPort(k_InputOne).Count);
                        Assert.AreEqual(numParents, node.GetParentsByPort(k_DifferentInput).Count);

                        Assert.AreEqual(0, node.GetChildrenByPort(k_DifferentOutput).Count);
                        Assert.AreEqual(numChildren, node.GetChildrenByPort(k_OutputOne).Count);

                        centerNodeWasFound = true;
                        break;
                    }
                }

                Assert.IsTrue(centerNodeWasFound, "Couldn't find middle of graph");
            }
        }
Пример #17
0
 internal ComputeSecrets(ComputeType computeType)
 {
     ComputeType = computeType;
 }
Пример #18
0
        public void CanFindParentsAndChildren([Values] Topology.SortingAlgorithm algo, [Values] ComputeType jobified)
        {
            using (var test = new Test(algo, jobified))
            {
                for (int i = 0; i < 5; ++i)
                {
                    test.Nodes.Add(test.TestDatabase.CreateNode());
                }


                test.TestDatabase.Connect(test.Nodes[0], k_OutputOne, test.Nodes[2], k_InputOne);
                test.TestDatabase.Connect(test.Nodes[1], k_OutputOne, test.Nodes[2], k_InputTwo);

                test.TestDatabase.Connect(test.Nodes[2], k_OutputOne, test.Nodes[3], k_InputOne);
                test.TestDatabase.Connect(test.Nodes[2], k_OutputTwo, test.Nodes[4], k_InputOne);

                bool centerNodeWasFound = false;

                foreach (var node in test.GetWalker())
                {
                    if (node.Vertex == test.Nodes[2])
                    {
                        var parents = new List <Node>();

                        foreach (var parent in node.GetParents())
                        {
                            parents.Add(parent.Vertex);
                        }

                        var children = new List <Node>();

                        foreach (var child in node.GetChildren())
                        {
                            children.Add(child.Vertex);
                        }

                        Assert.AreEqual(2, children.Count);
                        Assert.AreEqual(2, parents.Count);

                        Assert.IsTrue(parents.Exists(e => e == test.Nodes[0]));
                        Assert.IsTrue(parents.Exists(e => e == test.Nodes[1]));

                        Assert.IsTrue(children.Exists(e => e == test.Nodes[3]));
                        Assert.IsTrue(children.Exists(e => e == test.Nodes[4]));

                        centerNodeWasFound = true;
                        break;
                    }
                }

                Assert.IsTrue(centerNodeWasFound, "Couldn't find middle of graph");
            }
        }
 /// <summary>
 /// Initializes a new instance of the
 /// ComputeTypeCreateOrUpdateParameters class with required
 /// arguments.
 /// </summary>
 public ComputeTypeCreateOrUpdateParameters(ComputeType computeType)
     : this()
 {
     Ensure.IsNotNull(computeType, "computeType");
     this.ComputeType = computeType;
 }
Пример #20
0
            static void CaptureOrReportComputeHashInvocationOperation(OperationAnalysisContext context, MethodHelper methodHelper, DataCollector dataCollector, IInvocationOperation computeHashInvocation, ComputeType computeType)
            {
                switch (computeHashInvocation.Instance)
                {
                case ILocalReferenceOperation:
                    dataCollector.CollectComputeHashInvocation(computeHashInvocation, computeType);
                    break;

                case IInvocationOperation chainedInvocationOperation when methodHelper.IsHashCreateMethod(chainedInvocationOperation):
                    ReportChainedComputeHashInvocationOperation(chainedInvocationOperation.TargetMethod.ContainingType);

                    break;

                case IObjectCreationOperation chainObjectCreationOperation when methodHelper.IsObjectCreationInheritingHashAlgorithm(chainObjectCreationOperation):
                    ReportChainedComputeHashInvocationOperation(chainObjectCreationOperation.Type);

                    break;
                }

                void ReportChainedComputeHashInvocationOperation(ITypeSymbol originalHashType)
                {
                    if (!methodHelper.TryGetHashDataMethod(originalHashType, computeType, out var staticHashMethod))
                    {
                        return;
                    }

                    var diagnostics = CreateDiagnostics(computeHashInvocation, staticHashMethod.ContainingType, computeType);

                    context.ReportDiagnostic(diagnostics);
                }
            }
Пример #21
0
        public void ParentAndChildConnections_HasCorrectCounts([Values] Topology.SortingAlgorithm algo, [Values] ComputeType jobified)
        {
            using (var test = new Test(algo, jobified))
            {
                for (int i = 0; i < 5; ++i)
                {
                    test.Nodes.Add(test.TestDatabase.CreateNode());
                }

                test.TestDatabase.Connect(test.Nodes[0], k_OutputOne, test.Nodes[2], k_InputOne);
                test.TestDatabase.Connect(test.Nodes[1], k_OutputOne, test.Nodes[2], k_InputTwo);

                test.TestDatabase.Connect(test.Nodes[2], k_OutputOne, test.Nodes[3], k_InputOne);
                test.TestDatabase.Connect(test.Nodes[2], k_OutputTwo, test.Nodes[4], k_InputOne);

                bool centerNodeWasFound = false;

                foreach (var node in test.GetWalker())
                {
                    if (node.Vertex == test.Nodes[2])
                    {
                        Assert.AreEqual(2, node.GetParentConnections().Count);
                        Assert.AreEqual(1, node.GetParentConnectionsByPort(k_InputOne).Count);
                        Assert.AreEqual(1, node.GetParentConnectionsByPort(k_InputTwo).Count);

                        Assert.AreEqual(2, node.GetChildConnections().Count);
                        Assert.AreEqual(1, node.GetChildConnectionsByPort(k_OutputOne).Count);
                        Assert.AreEqual(1, node.GetChildConnectionsByPort(k_OutputTwo).Count);

                        centerNodeWasFound = true;
                        break;
                    }
                }

                Assert.IsTrue(centerNodeWasFound, "Couldn't find middle of graph");
            }
        }
Пример #22
0
        public void DeepImplicitlyCyclicDataGraph_ProducesDeferredError([Values] Topology.SortingAlgorithm algo, [Values] ComputeType computeType, [Values(0, 1, 10, 13, 100)] int depth)
        {
            using (var test = new Test(algo, computeType))
            {
                // create three branches
                Node
                    a = test.TestDatabase.CreateNode(),
                    b = test.TestDatabase.CreateNode(),
                    c = test.TestDatabase.CreateNode();

                // intertwine
                test.TestDatabase.Connect(a, k_OutputOne, b, k_InputOne);
                test.TestDatabase.Connect(b, k_OutputOne, c, k_InputOne);

                test.Nodes.Add(a);
                test.Nodes.Add(b);
                test.Nodes.Add(c);

                // fork off ->
                // o-o-o-o-o-o-o-o ...
                // |
                // o-o-o-o-o-o-o-o ...
                // |
                // o-o-o-o-o-o-o-o ...
                for (int i = 0; i < depth; ++i)
                {
                    a = test.TestDatabase.CreateNode();
                    b = test.TestDatabase.CreateNode();
                    c = test.TestDatabase.CreateNode();

                    test.TestDatabase.Connect(test.Nodes[i * 3 + 0], k_OutputOne, a, k_InputOne);
                    test.TestDatabase.Connect(test.Nodes[i * 3 + 1], k_OutputOne, b, k_InputOne);
                    test.TestDatabase.Connect(test.Nodes[i * 3 + 2], k_OutputOne, c, k_InputOne);

                    test.Nodes.Add(a);
                    test.Nodes.Add(b);
                    test.Nodes.Add(c);
                }

                // connect very last node to start, forming a cycle
                // -> o-o-o-o-o-o-o-o->
                // |  |
                // |  o-o-o-o-o-o-o-o->
                // |  |
                // |  o-o-o-o-o-o-o-o
                // -----------------|
                test.TestDatabase.Connect(test.Nodes[test.Nodes.Length - 1], k_OutputOne, test.Nodes[0], k_InputOne);

                var cache = test.GetUpdatedCache();

                Assert.AreEqual(1, cache.Errors.Length);
                Assert.AreEqual(Topology.TraversalCache.Error.Cycles, cache.Errors[0]);
            }
        }
Пример #23
0
        public void PartlyCyclicDataGraph_ProducesDeferredError([Values] Topology.SortingAlgorithm algo, [Values] ComputeType computeType)
        {
            using (var test = new Test(algo, computeType))
            {
                test.Nodes.Add(test.TestDatabase.CreateNode());
                test.Nodes.Add(test.TestDatabase.CreateNode());
                test.Nodes.Add(test.TestDatabase.CreateNode());

                test.TestDatabase.Connect(test.Nodes[0], k_OutputOne, test.Nodes[1], k_InputOne);
                test.TestDatabase.Connect(test.Nodes[1], k_OutputOne, test.Nodes[0], k_InputOne);
                test.TestDatabase.Connect(test.Nodes[2], k_OutputOne, test.Nodes[0], k_InputOne);

                var cache = test.GetUpdatedCache();

                Assert.AreEqual(1, cache.Errors.Length);
                Assert.AreEqual(Topology.TraversalCache.Error.Cycles, cache.Errors[0]);
            }
        }
Пример #24
0
        public void AlternateDependencies_CanDiffer_FromTraversal([Values] Topology.SortingAlgorithm algo, [Values] ComputeType computeType)
        {
            using (var test = new Test(algo, computeType, (uint)TraversalType.Normal, (uint)TraversalType.Different))
            {
                for (int i = 0; i < 4; ++i)
                {
                    test.Nodes.Add(test.TestDatabase.CreateNode());
                }

                // Setup normal traversal dependencies
                test.TestDatabase.Connect((uint)TraversalType.Normal, test.Nodes[0], k_OutputOne, test.Nodes[2], k_InputOne);
                test.TestDatabase.Connect((uint)TraversalType.Normal, test.Nodes[2], k_OutputOne, test.Nodes[3], k_InputOne);
                test.TestDatabase.Connect((uint)TraversalType.Normal, test.Nodes[0], k_OutputOne, test.Nodes[3], k_InputOne);

                // Setup an alternate dependency hierarchy
                test.TestDatabase.Connect((uint)TraversalType.Different, test.Nodes[3], k_OutputOne, test.Nodes[2], k_InputOne);
                test.TestDatabase.Connect((uint)TraversalType.Different, test.Nodes[2], k_OutputOne, test.Nodes[1], k_InputOne);
                test.TestDatabase.Connect((uint)TraversalType.Different, test.Nodes[1], k_OutputOne, test.Nodes[3], k_InputOne);

                foreach (var node in test.GetWalker())
                {
                    if (node.Vertex == test.Nodes[0])
                    {
                        Assert.Zero(node.GetParents().Count);
                        AssertAreSame(new List <Node> {
                            test.Nodes[2], test.Nodes[3]
                        }, node.GetChildren());
                        Assert.Zero(node.GetParents(Topology.TraversalCache.Hierarchy.Alternate).Count);
                        Assert.Zero(node.GetChildren(Topology.TraversalCache.Hierarchy.Alternate).Count);
                    }
                    if (node.Vertex == test.Nodes[1])
                    {
                        Assert.Zero(node.GetParents().Count);
                        Assert.Zero(node.GetChildren().Count);
                        AssertAreSame(new List <Node> {
                            test.Nodes[2]
                        }, node.GetParents(Topology.TraversalCache.Hierarchy.Alternate));
                        AssertAreSame(new List <Node> {
                            test.Nodes[3]
                        }, node.GetChildren(Topology.TraversalCache.Hierarchy.Alternate));
                    }
                    if (node.Vertex == test.Nodes[2])
                    {
                        AssertAreSame(new List <Node> {
                            test.Nodes[0]
                        }, node.GetParents());
                        AssertAreSame(new List <Node> {
                            test.Nodes[3]
                        }, node.GetChildren());
                        AssertAreSame(new List <Node> {
                            test.Nodes[3]
                        }, node.GetParents(Topology.TraversalCache.Hierarchy.Alternate));
                        AssertAreSame(new List <Node> {
                            test.Nodes[1]
                        }, node.GetChildren(Topology.TraversalCache.Hierarchy.Alternate));
                    }
                    if (node.Vertex == test.Nodes[3])
                    {
                        AssertAreSame(new List <Node> {
                            test.Nodes[0], test.Nodes[2]
                        }, node.GetParents());
                        Assert.Zero(node.GetChildren().Count);
                        AssertAreSame(new List <Node> {
                            test.Nodes[1]
                        }, node.GetParents(Topology.TraversalCache.Hierarchy.Alternate));
                        AssertAreSame(new List <Node> {
                            test.Nodes[2]
                        }, node.GetChildren(Topology.TraversalCache.Hierarchy.Alternate));
                    }
                }
            }
        }
Пример #25
0
        public void RootsAndLeaves_InternalIndices_AreRegistrered([Values] Topology.SortingAlgorithm algo, [Values] ComputeType jobified)
        {
            using (var test = new Test(algo, jobified))
            {
                for (int i = 0; i < 5; ++i)
                {
                    test.Nodes.Add(test.TestDatabase.CreateNode());
                }

                test.TestDatabase.Connect(test.Nodes[0], k_OutputOne, test.Nodes[2], k_InputOne);
                test.TestDatabase.Connect(test.Nodes[1], k_OutputOne, test.Nodes[2], k_InputTwo);

                test.TestDatabase.Connect(test.Nodes[2], k_OutputOne, test.Nodes[3], k_InputOne);
                test.TestDatabase.Connect(test.Nodes[2], k_OutputTwo, test.Nodes[4], k_InputOne);

                var cache = test.GetUpdatedCache();

                var rootWalker = new Topology.RootCacheWalker(cache);
                var leafWalker = new Topology.LeafCacheWalker(cache);

                var roots  = new List <Node>();
                var leaves = new List <Node>();

                Assert.AreEqual(rootWalker.Count, 2);
                Assert.AreEqual(leafWalker.Count, 2);

                foreach (var nodeCache in rootWalker)
                {
                    roots.Add(nodeCache.Vertex);
                }

                foreach (var nodeCache in leafWalker)
                {
                    leaves.Add(nodeCache.Vertex);
                }

                CollectionAssert.Contains(leaves, test.Nodes[0]);
                CollectionAssert.Contains(leaves, test.Nodes[1]);
                CollectionAssert.Contains(roots, test.Nodes[3]);
                CollectionAssert.Contains(roots, test.Nodes[4]);
            }
        }
Пример #26
0
        public void IslandNodes_RegisterBothAsLeafAndRoot([Values] Topology.SortingAlgorithm algo, [Values] ComputeType jobified)
        {
            using (var test = new Test(algo, jobified))
            {
                test.Nodes.Add(test.TestDatabase.CreateNode());

                var cache = test.GetUpdatedCache();

                Assert.AreEqual(cache.Leaves.Length, 1);
                Assert.AreEqual(cache.Roots.Length, 1);

                var roots = new List <Node>();

                for (int i = 0; i < cache.Leaves.Length; ++i)
                {
                    roots.Add(cache.OrderedTraversal[cache.Roots[i]].Vertex);
                }

                var leaves = new List <Node>();

                for (int i = 0; i < cache.Roots.Length; ++i)
                {
                    leaves.Add(cache.OrderedTraversal[cache.Leaves[i]].Vertex);
                }

                CollectionAssert.Contains(leaves, test.Nodes[0]);
                CollectionAssert.Contains(roots, test.Nodes[0]);
            }
        }
        public void UpdateAllBuffers(ComputeType type)
        {
            int kernelId = GetKernelID(type);

            UpdateAllBuffers(kernelId);
        }
Пример #28
0
        public void CanCongaWalkAndDependenciesAreInCorrectOrder([Values] Topology.SortingAlgorithm algo, [Values] ComputeType jobified)
        {
            using (var test = new Test(algo, jobified))
            {
                var node1 = test.TestDatabase.CreateNode();
                var node2 = test.TestDatabase.CreateNode();
                var node3 = test.TestDatabase.CreateNode();

                test.Nodes.Add(node1);
                test.Nodes.Add(node2);
                test.Nodes.Add(node3);

                test.TestDatabase.Connect(node1, k_OutputOne, node2, k_InputOne);
                test.TestDatabase.Connect(node2, k_OutputOne, node3, k_InputOne);

                var index = 0;

                foreach (var node in test.GetWalker())
                {
                    Assert.AreEqual(node.CacheIndex, index);
                    Assert.AreEqual(node.Vertex, test.Nodes[index]);

                    index++;
                }
            }
        }
 internal ComputeNodesInformation(ComputeType computeType, string nextLink)
 {
     ComputeType = computeType;
     NextLink    = nextLink;
 }
        public void Dispatch(ComputeType type)
        {
            int kernelId = GetKernelID(type);

            Dispatch(kernelId);
        }
Пример #31
0
 internal VirtualMachineSecrets(ComputeType computeType, VirtualMachineSshCredentials administratorAccount) : base(computeType)
 {
     AdministratorAccount = administratorAccount;
     ComputeType          = computeType;
 }
Пример #32
0
 public Test(Topology.SortingAlgorithm algo, ComputeType computingType)
     : this(algo, computingType, Topology.TraversalCache.TraverseAllMask)
 {
 }