Esempio n. 1
0
def test_SanitizeKernelPrototype_multiple_spaces():
  """Test that SanitizeKernelPrototype removes double whitespace."""
  assert (
    opencl.SanitizeKernelPrototype(
      """\
  kernel  void   A(global    float*  a) {}
"""
    )
    == """\
kernel void A(global float* a) {}
"""
  )
Esempio n. 2
0
def test_SanitizeKernelPrototype_leading_whitespace():
  """Test that SanitizeKernelPrototype strips leading whitespace."""
  assert (
    opencl.SanitizeKernelPrototype(
      """
kernel void A(global float* a) {}
"""
    )
    == """\
kernel void A(global float* a) {}
"""
  )
Esempio n. 3
0
def test_SanitizeKernelPrototype_empty_input():
    """Test SanitizeKernelPrototype on an empty input."""
    assert opencl.SanitizeKernelPrototype('') == ''