diff --git a/Src/ILGPU.Algorithms.Tests.CPU/CPUSGOOptimizerTests.cs b/Src/ILGPU.Algorithms.Tests.CPU/CPUSGOOptimizerTests.cs
new file mode 100644
index 000000000..3c4fce7d9
--- /dev/null
+++ b/Src/ILGPU.Algorithms.Tests.CPU/CPUSGOOptimizerTests.cs
@@ -0,0 +1,326 @@
+// ---------------------------------------------------------------------------------------
+// ILGPU Algorithms
+// Copyright (c) 2023-2024 ILGPU Project
+// www.ilgpu.net
+//
+// File: CPUSGOOptimizerTests.cs
+//
+// This file is part of ILGPU and is distributed under the University of Illinois Open
+// Source License. See LICENSE.txt for details.
+// ---------------------------------------------------------------------------------------
+
+using ILGPU.Algorithms.Optimization.CPU;
+using ILGPU.Algorithms.Random;
+using System;
+using System.Threading.Tasks;
+using Xunit;
+
+#if NET7_0_OR_GREATER
+
+#pragma warning disable CA1034 // Do not nest types
+#pragma warning disable CA1819 // Properties should not return arrays
+
+namespace ILGPU.Algorithms.Tests.CPU
+{
+ ///
+ /// Contains tests to verify the functionality of the CPU-specialized
+ /// class.
+ ///
+ public class CPUSGOOptimizerTests
+ {
+ #region CPU Functions
+
+ public interface IOptimizerTestFunction :
+ OptimizationTests.IPredefineTestFunction,
+ ICPUOptimizationFunction
+ { }
+
+ public readonly record struct TestBreakFunction(float Goal) :
+ ICPUOptimizationBreakFunction
+ {
+ public bool Break(float evalType, int iteration) =>
+ Math.Abs(evalType - Goal) < 1e-3f || iteration > 1000;
+ }
+
+ ///
+ /// Represents the Himmelblau function:
+ /// https://en.wikipedia.org/wiki/Test_functions_for_optimization
+ ///
+ public readonly record struct HimmelblauFunction : IOptimizerTestFunction
+ {
+ public float Evaluate(ReadOnlySpan position) =>
+ OptimizationTests.HimmelblauFunction.Evaluate(
+ position[0],
+ position[1]);
+
+ public bool CurrentIsBetter(float current, float proposed) =>
+ current < proposed;
+
+ public float Result =>
+ new OptimizationTests.HimmelblauFunction().Result;
+ public float[] LowerBounds =>
+ new OptimizationTests.HimmelblauFunction().LowerBounds;
+ public float[] UpperBounds =>
+ new OptimizationTests.HimmelblauFunction().UpperBounds;
+ }
+
+ ///
+ /// Represents the Easom function:
+ /// https://en.wikipedia.org/wiki/Test_functions_for_optimization
+ ///
+ public readonly record struct EasomFunction : IOptimizerTestFunction
+ {
+ public float Evaluate(ReadOnlySpan position) =>
+ OptimizationTests.EasomFunction.Evaluate(
+ position[0],
+ position[1]);
+
+ public bool CurrentIsBetter(float current, float proposed) =>
+ current < proposed;
+
+ public float Result =>
+ new OptimizationTests.EasomFunction().Result;
+ public float[] LowerBounds =>
+ new OptimizationTests.EasomFunction().LowerBounds;
+ public float[] UpperBounds =>
+ new OptimizationTests.EasomFunction().UpperBounds;
+ }
+ ///
+ /// Represents the Shaffer function N4:
+ /// https://en.wikipedia.org/wiki/Test_functions_for_optimization
+ ///
+ public readonly record struct ShafferFunction4 : IOptimizerTestFunction
+ {
+ public float Evaluate(ReadOnlySpan position) =>
+ OptimizationTests.ShafferFunction4.Evaluate(
+ position[0],
+ position[1]);
+
+ public bool CurrentIsBetter(float current, float proposed) =>
+ current < proposed;
+
+ public float Result =>
+ new OptimizationTests.ShafferFunction4().Result;
+ public float[] LowerBounds =>
+ new OptimizationTests.ShafferFunction4().LowerBounds;
+ public float[] UpperBounds =>
+ new OptimizationTests.ShafferFunction4().UpperBounds;
+ }
+
+ ///
+ /// Represents the Rosenbrock function constrained to a disk
+ /// https://en.wikipedia.org/wiki/Test_functions_for_optimization
+ ///
+ public readonly record struct RosenbrockDisk : IOptimizerTestFunction
+ {
+ public float Evaluate(ReadOnlySpan position) =>
+ OptimizationTests.RosenbrockDisk.Evaluate(
+ position[0],
+ position[1]);
+
+ public bool CurrentIsBetter(float current, float proposed) =>
+ current < proposed;
+
+ public float Result =>
+ new OptimizationTests.RosenbrockDisk().Result;
+ public float[] LowerBounds =>
+ new OptimizationTests.RosenbrockDisk().LowerBounds;
+ public float[] UpperBounds =>
+ new OptimizationTests.RosenbrockDisk().UpperBounds;
+ }
+
+ ///
+ /// Represents the Gomez and Levy function:
+ /// https://en.wikipedia.org/wiki/Test_functions_for_optimization
+ ///
+ public readonly record struct GomezAndLevyFunction : IOptimizerTestFunction
+ {
+ public float Evaluate(ReadOnlySpan position) =>
+ OptimizationTests.GomezAndLevyFunction.Evaluate(
+ position[0],
+ position[1]);
+
+ public bool CurrentIsBetter(float current, float proposed) =>
+ current < proposed;
+
+ public float Result =>
+ new OptimizationTests.GomezAndLevyFunction().Result;
+ public float[] LowerBounds =>
+ new OptimizationTests.GomezAndLevyFunction().LowerBounds;
+ public float[] UpperBounds =>
+ new OptimizationTests.GomezAndLevyFunction().UpperBounds;
+ }
+
+ #endregion
+
+ #region MemberData
+
+ public static TheoryData